Write a C++ program without using any loop (if, for, while
etc) to print numbers from 1 to 100 and 100 to 1;
Answer Posted / shubham gupta
#include<stdio.h>
void fun(int n)
{
static int i=1,j;
printf("%d\n",i);
(100-i)?(i++?fun(n):0):exit(0);
}
int main()
{
int n;
n=100;
fun(n);
}
| Is This Answer Correct ? | 1 Yes | 7 No |
Post New Answer View All Answers
What are structural members?
Explain the advantages and disadvantages of macros.
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
What will be the outcome of the following conditional statement if the value of variable s is 10?
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
What is function prototype?
Explain what is the heap?
Why doesnt the call scanf work?
Explain what is the difference between the expression '++a' and 'a++'?
Explain argument and its types.
How can you determine the maximum value that a numeric variable can hold?
How will you delete a node in DLL?
Explain goto?
What are the advantages of using new operator as compared to the function malloc ()?
What are preprocessor directives in c?