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
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
Why clrscr is used after variable declaration?
What is the scope of static variables in c language?
What is a dynamic array in c?
why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above
What is structure of c program?
What's a good way to check for "close enough" floating-point equality?
Is c procedural or functional?
What are the rules for identifiers in c?
Write a function that will take in a phone number and output all possible alphabetical combinations
What are the difference between a free-standing and a hosted environment?
What is the best way to store flag values in a program?
Why is c known as a mother language?
Define and explain about ! Operator?