ExamVeda
Login
Home
This question belongs to C Program C Fundamentals
C Fundamentals
?

What will be the output of the following C code?
#include <stdio.h>
int main()
{
   int i = 2;
   int j = ++i + i;
   printf("%d\n", j);
}

Answer & Solution
Correct Answer: Option A
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

1 Comment
Pramila Sahoo
Pramila Sahoo 8 months ago
Aise cases ko bolte hain undefined behaivior.
matlab same statement mein i ko change bhi kar rahe ho aur use bhi kar rahe ho - bina dropper sequence ke.
is code ka output undefined hai
kyunki ++i + i c mein undefined behavior create karta hai.