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

What is meant by keywords in c?

1068


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1162


What is c basic?

1166


How many main () function we can have in a project?

1107


Why c is called a middle level language?

1105


code for replace tabs with equivalent number of blanks

2156


What is the value of c?

1061


What is null in c?

1087


How do you view the path?

1125


provide an example of the Group by clause, when would you use this clause

2189


how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

3314


Explain what is the difference between functions abs() and fabs()?

1178


Apart from dennis ritchie who the other person who contributed in design of c language.

1393


If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above

1060


Write a program on swapping (100, 50)

1122