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
How can I generate floating-point random numbers?
What are the types of data structures in c?
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above
Where are local variables stored in c?
What are the different types of objects used in c?
Why do some versions of toupper act strangely if given an upper-case letter?
What is difference between array and structure in c?
Explain a pre-processor and its advantages.
How can I find the modification date of a file?
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
Is c procedural or functional?
What is struct node in c?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
How to declare pointer variables?
Explain what is a stream?