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
What is #include stdlib h?
What is the hardest programming language?
What is c preprocessor mean?
What is a buffer in c?
What is a program flowchart?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
Explain what is the best way to comment out a section of code that contains comments?
How variables are declared in c?
develop algorithms to add polynomials (i) in one variable
Explain bit masking in c?
What are the various types of control structures in programming?
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1
Why #include is used in c language?
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
What is a function simple definition?