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
Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).
Does there exist any other function which can be used to convert an integer or a float to a string?
What is the difference between containment and delegation?
Explain deep copy?
What is null c++?
What is a class template in c++?
When is dynamic checking necessary?
What is object in c++ example?
List the types of polymorphism in c++?
Is c++ a difficult language?
In c++, what is the difference between method overloading and method overriding?
Difference between Abstraction and encapsulation in C++?
Who calls main function?
Can a new be used in place of old mallocq? If yes, why?
Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work