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

write a program to find the given number is prime or not

2 Answers   Accenture, Vasutech,


Is it possible to have a function as a parameter in another function?

0 Answers  


4) Write a program that takes a 5 digit number and calculates 2 power that number and prints it. i have done maximum par but i m findind problem in the commented area. please help...

3 Answers  


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

2 Answers   Aricent, Manipal University,


What does %p mean?

0 Answers  


main() { char *p1="Name"; char *p2; p2=(char *)malloc(20); while(*p2++=*p1++); printf("%s\n",p2); } what is the output?

7 Answers   AMCAT, HCL, Ramco, Zycus Infotech,


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

0 Answers   Wipro,


program to find the second largest word in a paragraph amongst all words that repeat more thn twice

4 Answers   CTS, iGate,


what is the function of pragma directive in c?

0 Answers  


What is getche() function?

0 Answers  


Write a c program to find, no of occurance of a given word in a file. The word is case sensitive.

2 Answers  


Difference between Function to pointer and pointer to function

0 Answers  


Categories