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 without using any loop (if, for, while
etc) to print numbers from 1 to 100 and 100 to 1;

Answer Posted / govind

#include<conio.h>
#include<stdio.h>
void main()
{
int i;
clrscr();
printf("\n the value of the 100 to 0 \n");
for(i=100;i>0;i--)
{
if(i==0)
{
goto start;
}
printf(" %d\t",i);
}

printf("\nthe value of the 0 to 100 \n ");
start:
if(i==100)
{
goto end;
}
printf("%d\t",i);
i++;
goto start;
end :
printf("End of the program");
getch();
}

Is This Answer Correct ?    6 Yes 67 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between malloc() and calloc() function?

1196


how do you programme Carrier Sense Multiple Access

1966


When the macros gets expanded?

1418


What does the error message "DGROUP exceeds 64K" mean?

1215


Explain the concept and use of type void.

1111


Explain the use of fflush() function?

1075


What is header file in c?

1064


Why do we use namespace feature?

1051


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

2319


What is pointer and structure in c?

1166


Why clrscr is used after variable declaration?

1683


Explain the difference between ++u and u++?

1130


Why ca not I do something like this?

1007


What is a rvalue?

1201


FILE PROGRAMMING

2229