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 clrscr is used in c?

1024


What is the basic structure of c?

1097


how to count no of words,characters,lines in a paragraph.

4434


How do shell structures work?

1125


Explain the advantages of using macro in c language?

1009


What is typedef struct in c?

1060


What is the size of empty structure in c?

1095


Why c is known as a mother language?

1096


In c programming language, how many parameters can be passed to a function ?

1125


What is this infamous null pointer, anyway?

1070


Write a program to print “hello world” without using semicolon?

1129


Can you mix old-style and new-style function syntax?

1110


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

1166


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1874


How does struct work in c?

1098