Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Why can’t constant values be used to define an array’s initial size?

1438


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.

1734


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1132


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

1904


Define the scope of static variables.

1190


Is c object oriented?

1011


what is the significance of static storage class specifier?

2338


What is a char in c?

1038


What is typedef example?

1255


What are the applications of c language?

1123


What is the purpose of main( ) in c language?

1184


What is the process of writing the null pointer?

1056


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

1252


What is #include cctype?

1174


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15887