Question: 2. How many times is the cout statement executed? for (int i = 0; i < 10; i++) for (int j = 0; j <
2. How many times is the cout statement executed?
for (int i = 0; i < 10; i++) for (int j = 0; j < 10; j++) cout << i * j << endl;
a. 100
b. 20
c. 10
d. none of the above
3. Given an array of integers, write the C++ code to compute the number of even numbers in the array, e.g. array = [2, 56, 7, 10, 11, 3, 41, 33], the number of even numbers is 3, they are 2, 56, 10
4. Given an array of 20 integers, replace each integer with its value mod 5, e.g.
If the integer is 5, its new value is 0, if the integer is 21, the new values is 1, etc.
| 5. What is the output of the following: int a; int* p; a = 2; p = a; a = a + 2; cout << *p; |
| a. 2 b. 3 c. Wont run d. None of the above |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
