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


Please Help Members By Posting Answers For Below Questions

What is the function of volatile in c language?

668


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

600


In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none

720


Do you know null pointer?

611


can any one tel me wt is the question pattern for NIC exam

1558






Explain what are compound statements?

605


Is c call by value?

607


Write a program to implement queue.

666


what is the function of pragma directive in c?

626


What does c mean in basketball?

563


the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?

566


write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...

1489


What are the header files used in c language?

589


Are there any problems with performing mathematical operations on different variable types?

575


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1076