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 / sandy
#include<iostream>
int i;
class A
{
public:
A(){cout<<i++<<endl;}
~A(){cout<<--i<<endl;}
}
int main()
{
A a[100];
return 0;
}
| Is This Answer Correct ? | 41 Yes | 10 No |
Post New Answer View All Answers
What is the collection of communication lines and routers called?
What is #define used for in c?
Explain union.
Explain what is a const pointer?
Which of these functions is safer to use : fgets(), gets()? Why?
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
For what purpose null pointer used?
Differentiate between full, complete & perfect binary trees.
List the difference between a 'copy constructor' and a 'assignment operator' in C?
What is a lookup table in c?
Why is sizeof () an operator and not a function?
Explain about the functions strcat() and strcmp()?
What is c variable?
What are the advantages of Macro over function?
Can one function call another?