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
define string ?
What are qualifiers?
What are compound statements?
what type of questions arrive in interview over c programming?
What does *p++ do?
Explain how do you determine whether to use a stream function or a low-level function?
Tell me what are bitwise shift operators?
Can I initialize unions?
Explain how can I convert a number to a string?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
Is there any possibility to create customized header file with c programming language?
Explain how do you sort filenames in a directory?
Define C in your own Language.
What does %2f mean in c?
How can you increase the size of a statically allocated array?