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 is #include stdlib h?
int i=10; printf("%d %d %d", i, i=20, i);
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
what is a constant pointer in C
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
What is the use of clrscr?
Tell me what is null pointer in c?
How can I find out if there are characters available for reading?
Why is c platform dependent?
What is call by reference in functions?
What does calloc stand for?
write a program to print largest number of each row of a 2D array
What is sizeof c?
What is the use of header?
Explain how can you tell whether a program was compiled using c versus c++?