[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

C Programming :: Increment-Decrement - Discussion

Home > C Programming > Increment-Decrement > MCQs Questions Discussion

23 / 45

What will be the final value of num1 and num2?

#include <stdio.h>
int main()
{
long num1 = 0;
long num2 = 0;
long *pnum = NULL;
pnum = &num1;
*pnum = 2;
++num2;
num2 += *pnum; 
pnum = &num2;
++*pnum;
return 0;
}

Anum1 = 2 num2 = 4

Bnum1 = 4 num2 = 2

CCompilaton Error

Dnum1 = 4 num2 = 4

Answer: Option (Login/Signup)

Show Explanation

Asked In ::

Post Your Answer Here:     

No Discussion on this question yet!