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
-
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
-
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
-
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
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