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
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
How can I run c program?
What is a macro in c preprocessor?
Was 2000 a leap year?
What is static memory allocation? Explain
Give differences between - new and malloc() , delete and free() ?
using only #include
Explain what is the concatenation operator?
What is the difference between ++a and a++?
Give the rules for variable declaration?
What functions are in conio h?
Differentiate between the = symbol and == symbol?
What is a list in c?
Explain can the sizeof operator be used to tell the size of an array passed to a function?
cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration