1.

What is the output of this program?
#include 
using namespace std;
int main ()
{
int num[5];
int * ptr;
ptr = num; *ptr = 12;
ptr++; *ptr = 21;
ptr = &num[2]; *ptr = 35;
ptr = num + 3; *ptr = 14;
ptr = num; *(ptr + 4) = 53;
for (int k = 0; k < 5; k++)
cout << num[k] << ",";
return 0;
}

A. 12,21,35,14,53,
B. 35,14,53,
C. 14,53,
D. 12,21,35,14
E. 12,21
Answer» B. 35,14,53,


Discussion

No Comment Found

Related MCQs