write a program to display the numbers having digit 9 in the
given range from 1 to 100



write a program to display the numbers having digit 9 in the given range from 1 to 100 ..

Answer / neha

public class DisplayNumbers {
public static void main(String args[])
{
int num=0,Nine=9;
for(int i=1;i<100;i++)
{
int rem=i/10;

num=i%10;

if(num==Nine || rem==Nine)
{
System.out.println("Number is :: "+ i);
}
}
}

}

Is This Answer Correct ?    12 Yes 0 No

Post New Answer

More C Interview Questions

What is FIFO?

3 Answers  


Tell me about low level programming languages.

0 Answers   Amdocs,


Explain what is a 'locale'?

0 Answers  


Is python a c language?

0 Answers  


What is the output of the program given below #include<stdio.h> main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

21 Answers   ADITI, Student, TCS,


Is using exit() the same as using return?

0 Answers  


10. Study the code: void show() main() { show(); } void show (char *s) { printf("%sn",s); } What will happen if it is compiled & run on an ANSI C Compiler? A)It will compile & nothing will be printed when it is executed B)it will compile but not link C)the compiler will generate an error D)the compiler will generate a warning

5 Answers   Accenture,


Which is an example of a structural homology?

0 Answers  


When is the “void” keyword used in a function?

1 Answers  


what will be the output for the following main() { printf("hi" "hello"); }

5 Answers   RoboSoft,


write a program to swap two variables a=5 , b= 10 without using third variable

5 Answers  


main() { int age; float ht; printf("Enter height and age"); scanf("%d%d",&height,&age); if((age<=20)&&(ht>=5)) {printf("She loves you");} else {printf("She loves you");} }

2 Answers  


Categories