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
Why clrscr is used in c?
What is the basic structure of c?
how to count no of words,characters,lines in a paragraph.
How do shell structures work?
Explain the advantages of using macro in c language?
What is typedef struct in c?
What is the size of empty structure in c?
Why c is known as a mother language?
In c programming language, how many parameters can be passed to a function ?
What is this infamous null pointer, anyway?
Write a program to print “hello world” without using semicolon?
Can you mix old-style and new-style function syntax?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
How does struct work in c?