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 different categories of functions in c?
What is the difference between array and linked list in c?
Differentiate between static and dynamic modeling.
What are the __date__ and __time__ preprocessor commands?
#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }
What is type qualifiers?
What is extern keyword in c?
In C, What is the #line used for?
Why main is not a keyword in c?
stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.
Can a variable be both static and volatile in c?
Write a program to print fibonacci series without using recursion?
What is the difference between exit() and _exit() function in c?
Write a program on swapping (100, 50)
what do the 'c' and 'v' in argc and argv stand for?