Write a C program to print 1 2 3 ... 100 without using
loops?
Answer Posted / uma maheswari
#include<stdio.h>
#include<conio.h>
int i=1;
void main()
{
i<=100 ? printf("%d\n",i) : getch(); //conditional operator
i++;
main(); //recursive calling of main() function
}
| Is This Answer Correct ? | 10 Yes | 7 No |
Post New Answer View All Answers
How can I insert or delete a line (or record) in the middle of a file?
What is a protocol in c?
What are the features of the c language?
What is the difference between if else and switchstatement
what is reason of your company position's in india no. 1.
What is time complexity c?
What are the difference between a free-standing and a hosted environment?
What are the loops in c?
When should I declare a function?
Tell us something about keyword 'auto'.
What is the use of f in c?
Is c easier than java?
Can you please explain the difference between malloc() and calloc() function?
How can I automatically locate a programs configuration files in the same directory as the executable?
What are header files why are they important?