Free CPA-21-02 Exam Braindumps (page: 16)

Page 16 of 65

What happens when you attempt to compile and run the following code?

#include <iostream>

using namespace std;

int main()
{
int x=2, *y;
y = &x;
cout << *y + x;
return 0;

}

  1. It prints: 1
  2. It prints: 2
  3. It prints: 4
  4. It prints: 0

Answer(s): C



What happens when you attempt to compile and run the following code?

#include <iostream>
using namespace std;

int main(){
int *i;
i = new int;
*i = 1.0 / 2 * 2 / 1 * 2 / 4 * 4;
cout << *i;
return 0;
}

  1. It prints: 0
  2. It prints: 1
  3. It prints: 2
  4. It prints: 0.5

Answer(s): C



Which of the following statements are correct about an array? int tab[10];

  1. The array can store 10 elements.
  2. The expression tab[1] designates the very first element in the array.
  3. The expression tab[9] designates the last element in the array.
  4. It is necessary to initialize the array at the time of declaration.

Answer(s): A,C



Which of the following is a logical operator?

  1. &
  2. &&
  3. ||
  4. !

Answer(s): B,C,D



Page 16 of 65



Post your Comments and Discuss C++ Institute CPA-21-02 exam with other Community members:

Subash commented on October 21, 2024
I am planning to take this exam. Are these 257 questions enough to clear it? Also, does each section have a passing percentage, or is it based on the overall ?
INDIA
upvote