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 / jihad mzahim
int main()
{
int i=100;
start:
if(i==0)
{
printf("\t\t************************************************\n\n");
goto start1;
}
printf("%d\t",i);
i--;
goto start;
start1:
if(i==101)
goto end;
printf("%d\t",i);
i++;
goto start1;
end:
printf("\n end of the program");
return 0;
}
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
What is scope rule in c?
Which is the best website to learn c programming?
Does c have an equivalent to pascals with statement?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
how to print the character with maximum occurence and print that number of occurence too in a string given ?
What does int main () mean?
What is typeof in c?
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
Can a variable be both constant and volatile?
What are type modifiers in c?
What are the scope of static variables?
What are the advantages of c preprocessor?
What is c token?
Is it acceptable to declare/define a variable in a c header?
Can we increase size of array in c?