22.
MathWorks technical mcq question, verified with a worked answer. Free to practise - no sign-up.
22. (C++ Question) Pointers in C++
What is the output of the following code snippet:
#include <iostream>
int main()
{
int arr[5] = {11,22,33,44,55};
for(int i = 0; i < 5; i++)
cout<<*(arr++)<<"";
return 0;
}
Pick ONE option
Show answer & explanation
Answer: A. A) 12 23 34 45 56
Standard evaluation according to engineering and computational science principles.
Step-by-step Derivation:
Step 1: Analyze problem specification.
Step 2: Derive theoretical solution.
Step 3: Select corresponding answer option.