Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions

Question

Explain workplace flexibility (work-life balance).

Answered: 1 week ago

Question

Did gender play any role in the fortunes of Fiorina and Dunn?

Answered: 1 week ago