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

how does a general function , that accepts an array as a parameter, "knows" the size of the array ? How should it define it parameters list ?

0 Answers  


Is a house a mass structure?

0 Answers  


Explain two-dimensional array.

0 Answers  


Which is better pointer or array?

0 Answers  


How to reverse a string using a recursive function, with swapping?

5 Answers  






What does a run-time "null pointer assignment" error mean?

2 Answers  


wat are the two methods for swapping two numbers without using temp variable??

2 Answers  


What is difference between structure and union in c?

0 Answers  


What is pragma c?

0 Answers  


What are c preprocessors?

0 Answers  


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures

0 Answers   KPIT,


What is a pointer in c?

0 Answers  


Categories