Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions