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
How can you find the exact size of a data type in c?
How do we declare variables in c?
What does void main () mean?
What is extern variable in c with example?
Is that possible to add pointers to each other?
Using which language Test cases are added in .ptu file of RTRT unit testing???
What does dm mean sexually?
Explain what are global variables and explain how do you declare them?
What are the 5 types of organizational structures?
Explain built-in function?
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
How does #define work?
Write a program to use switch statement.
Explain how can I convert a string to a number?
Why use int main instead of void main?