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
Difference between malloc() and calloc() function?
how do you programme Carrier Sense Multiple Access
When the macros gets expanded?
What does the error message "DGROUP exceeds 64K" mean?
Explain the concept and use of type void.
Explain the use of fflush() function?
What is header file in c?
Why do we use namespace feature?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
What is pointer and structure in c?
Why clrscr is used after variable declaration?
Explain the difference between ++u and u++?
Why ca not I do something like this?
What is a rvalue?
FILE PROGRAMMING