InterviewSolution
Saved Bookmarks
| 1. |
write a program to display all the numbers between hundred and 200 which don't contain zeros at any position |
|
Answer» PROGRAM ON BLUEJ JAVA environment:-import java.util.*; // java utility package//class position // class name{public static void main(){Scanner Sc=new Scanner(System.in);System.out.println("Enter the number between 100 and 200:");int n=Sc.nextInt();. //To initialise variable nint t=n;// To copy variable n to twhile(t GREATER than 100 and less than 200){d=t%10. //loop checking condition//if(d!=0){c=c+1;}t=t/10;}if(d==n){System.out.println("Numbers which do not contain ZERO at any position:"); //To display numbers which don't contain zero at any position//System.out.println(c);}}} |
|