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 / raveendra
#include<iostream.h>
using namespace std;
int i;
class A
{
public:
static void fun()
{
A a[100];
}
A(){cout<<++i<<"\t";}
~A(){cout<<i--<<"\t";}
};
int main()
{
A::fun();
getchar();
return 0;
}
Is This Answer Correct ? | 1 Yes | 3 No |
Post New Answer View All Answers
What are multidimensional arrays?
How can I discover how many arguments a function was actually called with?
What is infinite loop?
What is the basic structure of c?
Explain what is the difference between a free-standing and a hosted environment?
how do you programme Carrier Sense Multiple Access
What is string function c?
What does the c in ctime mean?
What is C language ?
Explain how can a program be made to print the name of a source file where an error occurs?
What is an operator?
Is c object oriented?
What is the explanation for the dangling pointer in c?
what is reason of your company position's in india no. 1.
What are the functions to open and close the file in c language?