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

List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

0 Answers   Ignou,


Can you return null in c?

0 Answers  


What is data types?

0 Answers  


What is extern c used for?

0 Answers  


What are the advantages of Macro over function?

1 Answers  






Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

0 Answers  


what type of language is C?

13 Answers   Microsoft,


1.what are local and global variables? 2.what is the scope of static variables? 3.what is the difference between static and global variables? 4.what are volatile variables? 5.what is the use of 'auto' keyword? 6.how do we make a global variable accessible across files? Explain the extern keyword? 7.what is a function prototype? 8.what does keyword 'extern' mean in a function declaration?

0 Answers  


Which is best book for data structures in c?

0 Answers  


main() { intj; while9j<=10) { printf("\n%d",j); j=j+1; } }

4 Answers  


palindrome for strings and numbers----Can anybody do the prog?

6 Answers   CTS, TCS, Vipro Lifescience Pvt,


Write a program in C to print the alphabets in order as on a mobile phone.i.e:When 2 is pressed once 'a' prints and if it is pressed two times 'b' prints and so on.we have to print all the alphabets as on mobile phone like this.

1 Answers   Wipro,


Categories