write a program to display the numbers having digit 9 in the
given range from 1 to 100
Answer Posted / 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 View All Answers
What are the types of pointers in c?
What is the advantage of using #define to declare a constant?
what type of questions arrive in interview over c programming?
How do you use a pointer to a function?
What is the use of a static variable in c?
How many identifiers are there in c?
Can you please explain the scope of static variables?
What are the types of i/o functions?
How pointers are declared?
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
What is 1f in c?
pierrot's divisor program using c or c++ code
What is a nested formula?
What are the c keywords?
Write a C program to count the number of email on text