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

Why we write conio h in c?

0 Answers  


sqrt(x+sqrt(x+sqrt(x+sqrt(x))))=2; Find the value of x?

4 Answers   Subex,


what is the difference between exit() and _exit() functions?

2 Answers  


Is c dynamically typed?

0 Answers  


True or false: If you continuously increment a variable, it will become negative? 1) True 2) False 3) It depends on the variable type

7 Answers  






main() { float f1=10.5; double db1=10.5 if(f1==db1) printf("a"); else printf("b") }

2 Answers   CSC,


Tell me with an example the self-referential structure?

0 Answers  


What does do in c?

0 Answers  


How can you find the exact size of a data type in c?

0 Answers  


Why shouldn’t I start variable names with underscores?

0 Answers  


Which of the following are valid "include" formats? A)#include and #include[file.h] B)#include (file.h) and #include C)#include [file.h] and #include "file.h" D)#include <file.h> and #include "file.h"

15 Answers   Accenture,


What is malloc calloc and realloc in c?

0 Answers  


Categories