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 is the use of a semicolon (;) at the end of every program statement?
Explain b+ tree?
How can I manipulate individual bits?
Difference between malloc() and calloc() function?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
What is the difference between functions getch() and getche()?
Write a program to print ASCII code for a given digit.
What are pointers? What are stacks and queues?
What are linker error?
What is indirection? How many levels of pointers can you have?
What is keyword in c?
Explain what is wrong with this program statement?
How can I get the current date or time of day in a c program?
Which is best book for data structures in c?
Give differences between - new and malloc() , delete and free() ?