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 / ajeet kumar
#include<stdio.h>
#include<conio.h>
int f(int);
void main()
{
static int n=0;
n++>99 ? 0 : f(n) ; //its value are not used.
}
int f(int n)
{
printf(" %d",n);
main();
printf(" %d",n--); //]internally stack is ctr
return(1);
} /* run firstly,after press alt+F5.
Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Who invented b language?
Explain Function Pointer?
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
What are integer variable, floating-point variable and character variable?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
What is meant by type casting?
What is the main difference between calloc () and malloc ()?
Is there a way to compare two structure variables?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
What is getch() function?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
Is c compiled or interpreted?
What is the difference between call by value and call by reference in c?
What is exit() function?