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 |
suppose there are five integers write a program to find larger among them without using if- else
Explain what is the benefit of using an enum rather than a #define constant?
What is sorting in c plus plus?
Is calloc better than malloc?
different between overloading and overriding
Just came across this question, felt worth sharing, so here it is I want you to make a C/C++ program that for any positive integer n will print all the positive integers from 1 up to it and then back again! Let's say n=5 I want the program to print: 1 2 3 4 5 4 3 2 1. Too easy you say? Okay then... You can ONLY USE: 1 for loop 1 printf/cout statement 2 integers( i and n) and as many operations you want. NO if statements, NO ternary operators, NO tables, NO pointers, NO functions!
How can I access memory located at a certain address?
wat are the two methods for swapping two numbers without using temp variable??
int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d", i);
write a program that accepts 3 numbers from the user. dispaly the values in a descending order.
What is the benefit of using #define to declare a constant?
44.what is the difference between strcpy() and memcpy() function? 45.what is output of the following statetment? 46.Printf(“%x”, -1<<4); ? 47.will the program compile? int i; scanf(“%d”,i); printf(“%d”,i); 48.write a string copy function routine? 49.swap two integer variables without using a third temporary variable? 50.how do you redirect stdout value from a program to a file? 51.write a program that finds the factorial of a number using recursion?