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 can’t constant values be used to define an array’s initial size?
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
Define the scope of static variables.
Is c object oriented?
what is the significance of static storage class specifier?
What is a char in c?
What is typedef example?
What are the applications of c language?
What is the purpose of main( ) in c language?
What is the process of writing the null pointer?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
What is #include cctype?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10