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 meant by type specifiers?
Explain the process of converting a Tree into a Binary Tree.
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
how to introdu5ce my self in serco
What is a void * in c?
What is "Hungarian Notation"?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
hi, which software companys will take,if d candidate's % is jst 55%?
Distinguish between actual and formal arguments.
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
What is a example of a variable?
What is a null string in c?
What are shell structures used for?
What are the basic data types associated with c?