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

Can an array be an Ivalue?

1089


Explain spaghetti programming?

1242


What is memory leak in c?

1123


Explain the use of bit fieild.

1137


Explain low-order bytes.

1029


What is getch?

1183


Differentiate between full, complete & perfect binary trees.

1089


What is meant by initialization and how we initialize a variable?

1046


Define macros.

1263


write a program to print largest number of each row of a 2D array

2323


what are the advantages of a macro over a function?

1138


Are pointers really faster than arrays?

1020


What would happen to X in this expression: X += 15; (assuming the value of X is 5)

1948


Explain how are 16- and 32-bit numbers stored?

1263


What is the best style for code layout in c?

1094