Question
A C++ program named examProg that has been coded to accept command-line arguments is run at the Unix command line as follows: z1234567@turing:~$ ./examProg data.txt
A C++ program named examProg that has been coded to accept command-line arguments is run at the Unix command line as follows:
z1234567@turing:~$ ./examProg data.txt 20 3
What will be the value of the parameter argv[2]?
| A. | The integer value 20 |
| B. | The C string "20" |
| C. | The C string "./examProg" |
| D. | The C string "data.txt" |
Assume that we have the following C++ program:
#include
using namespace std;
int num = 10;
int sum(int, int);
int main()
{
int x = 3, y = 5;
cout << sum(x, y) + num << endl;
return 0;
}
int sum(int a, int b)
{
return (a + b);
}
What is the storage class of the variable a?
| A. | automatic storage |
| B. | static storage |
| C. | dynamic storage |
QUESTION 12
- Assume that we have the following C++ program: #include
- using namespace std;
- int num = 10;
- int sum(int, int);
- int main()
- {
- int x = 3, y = 5;
- cout << sum(x, y) + num << endl;
- return 0;
- }
- int sum(int a, int b)
- {
- return (a + b);
- }
- What is the scope of the variable num?
. | . A. | . class scope |
. | . B. | . file scope |
. | . C. | . function scope |
. | . D. | . block scope |
. Answer all please
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started