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

If errno contains a nonzero number, is there an error?

1292


What are the benefits of organizational structure?

973


Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.

1055


Explain how can you tell whether two strings are the same?

971


Disadvantages of C language.

1046


How can you determine the size of an allocated portion of memory?

1238


GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA

1834


What are formal parameters?

1070


What is bss in c?

1045


What is wrong with this code?

1128


GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

1047


What is the function of this pointer?

1219


What is quick sort in c?

1021


Write a C program to count the number of email on text

1854


Which control loop is recommended if you have to execute set of statements for fixed number of times?

1298