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 meant by keywords in c?
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
What is c basic?
How many main () function we can have in a project?
Why c is called a middle level language?
code for replace tabs with equivalent number of blanks
What is the value of c?
What is null in c?
How do you view the path?
provide an example of the Group by clause, when would you use this clause
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
Explain what is the difference between functions abs() and fabs()?
Apart from dennis ritchie who the other person who contributed in design of c language.
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above
Write a program on swapping (100, 50)