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 differnce between programing langauge and tool? is sas is a programing langauge r tool?

2320


why do some people write if(0 == x) instead of if(x == 0)?

1021


Is that possible to add pointers to each other?

1331


Which function in C can be used to append a string to another string?

1181


What are 3 types of structures?

1032


Is c++ based on c?

1032


What is the value of uninitialized variable in c?

986


I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.

2173


What is a header file?

1039


What is calloc malloc realloc in c?

1021


Tell us something about keyword 'auto'.

1018


What is malloc calloc and realloc in c?

1230


Write a simple code fragment that will check if a number is positive or negative.

1111


What is the benefit of using const for declaring constants?

996


What is the full form of getch?

1200