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


Please Help Members By Posting Answers For Below Questions

Are there namespaces in c?

570


What is the difference between array and linked list in c?

603


Who developed c language?

643


Is c language still used?

538


C language questions for civil engineering

1246






Is void a keyword in c?

578


What is meant by keywords in c?

618


In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)

1634


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

635


general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only

589


Tell me can the size of an array be declared at runtime?

600


What are the primitive data types in c?

579


Explain how can I right-justify a string?

626


Why dont c comments nest?

623


Can we add pointers together?

621