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 would happen to X in this expression: X += 15; (assuming the value of X is 5)
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
Why is c so important?
What is include directive in c?
What is meant by type specifiers?
Is there any data type in c with variable size?
What does the file stdio.h contain?
What is string function in c?
How would you rename a function in C?
Where are some collections of useful code fragments and examples?
What is the difference between malloc() and calloc()?
what is reason of your company position's in india no. 1.
Can a pointer be volatile in c?
Compare array data type to pointer data type
How many keywords are there in c?