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
Can we change the value of static variable in c?
Which driver is a pure java driver
How can I write functions that take a variable number of arguments?
What is an lvalue in c?
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
what value is returned to operating system after program execution?
What is structure of c program?
Why does the call char scanf work?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
Write a program to print “hello world” without using semicolon?
What language is lisp written in?
When should structures be passed by values or by references?
How do you convert strings to numbers in C?
Why do we use main function?
What is hashing in c?