Write a C program to print 1 2 3 ... 100 without using
loops?
Answer Posted / sagar
we can also create such a program without using loops and if
statement too ...
void main()
{
int i,n;
clrscr();
A:
printf("%d",i);
n=i++;
switch(n)
{
case 100: break;
default : goto A;
}
getch();
}
| Is This Answer Correct ? | 9 Yes | 7 No |
Post New Answer View All Answers
What are the valid places to have keyword “break”?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
Does c have enums?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9
What is build process in c?
Whats s or c mean?
What is zero based addressing?
a program that can input number of records and can view it again the record
Explain argument and its types.
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
What is the purpose of macro in C language?
What is #include cctype?
Why malloc is faster than calloc?