Computer Science, asked by mailtobidita, 2 months ago

3. Write a program to display all the numbers between 100 and 200 which don't contain
zeros at any position.
For example: 111, 112, 113...
199

Answers

Answered by rkbaishnab72
1

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 n

int t=n;// To copy variable n to t

while(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);

}

}

}

Similar questions