Question: QUESTION 5 Assume that we have the following C++ program: #include using namespace std; const int num = 10; int sum(int, int); int main() {

QUESTION 5

  1. Assume that we have the following C++ program:

    #include  using namespace std; const 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.

    file scope

    B.

    function scope

    C.

    class scope

    D.

    block scope

1 points

QUESTION 6

  1. In what part of a C++ program's memory are automatic variables stored?

    A.

    The free store

    B.

    The uninitialized data segment of the static data region (BSS)

    C.

    The initialized data segment of the static data region

    D.

    The stack

1 points

QUESTION 7

  1. Write a definition for a function that takes one argument, an array of char that contains a C string that will not be altered by the function. The function should return an integer representing the number of numeric digits contained in the C string. The C library function isdigit() can be used to determine whether or not a character is a numeric digit.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!