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 outcome of cout< a) 16 b) 17 c) 16.5

971


Explain the static member function.

1115


How delete [] is different from delete?

955


What is an associative container in c++?

1005


find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.

2466


What relational operators if statements in c++?

1113


How long does it take to get good at leetcode?

1116


What is set in c++?

1066


What is the most powerful coding language?

997


What is a class template in c++?

1000


What are the differences between new and malloc?

1045


what does the following statement mean? int (*a)[4]

1028


List the types of polymorphism in c++?

1052


Why we use #include iostream in c++?

989


What sorting algorithm does c++ use?

1075