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
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none
What is a void * in c?
What is a keyword?
List out few of the applications that make use of Multilinked Structures?
What are the parts of c program?
What’s a signal? Explain what do I use signals for?
When should I declare a function?
Explain what are its uses in c programming?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
What type is sizeof?
What are dangling pointers in c?
Why c is faster than c++?
Explain what is wrong with this statement? Myname = ?robin?;
How can I read a binary data file properly?
How can I prevent another program from modifying part of a file that I am modifying?