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...

print first nodd numbers in descending order

Answer Posted / rabid manatee

#include <iostream>
using namespace std;

int main(int argc, char *argv[]) {

int n = 4;

if (argc == 2) {
n = atoi(argv[1]);
}

for(int i=n; i >= 0; i--) {
cout << i*2 + 1 <<endl;
}

}

Is This Answer Correct ?    3 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the latest version on c++?

1182


What are inline functions? What is the syntax for defining an inline function?

1212


Can we distribute function templates and class templates in object libraries?

1131


What does flush do?

1048


How do you generate a random number in c++?

1150


When we use Abstract Class and when we use Interface?where we will implement in real time?

2240


What is pointer -to-members in C++? Give their syntax?

1076


How do I make turbo c++ full screen?

1127


What is virtual destructor? What is its use?

1120


What is the c++ programming language used for?

1093


what is the difference between overloading & overriding? give example.

1266


Can we use struct in c++?

1073


What is time h in c++?

1184


What is a set in c++?

1029


What are activex and ole?

1111