Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What is the use of a semicolon (;) at the end of every program statement?

1410


Explain b+ tree?

1003


How can I manipulate individual bits?

981


Difference between malloc() and calloc() function?

1126


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

1111


What is the difference between functions getch() and getche()?

1031


Write a program to print ASCII code for a given digit.

1033


What are pointers? What are stacks and queues?

1061


What are linker error?

1031


What is indirection? How many levels of pointers can you have?

1087


What is keyword in c?

957


Explain what is wrong with this program statement?

1064


How can I get the current date or time of day in a c program?

1163


Which is best book for data structures in c?

1035


Give differences between - new and malloc() , delete and free() ?

1038