Multiple choice technology programming languages

Determine output: void main(){ int x,y; x = 5; y = ++x * ++x; printf("Value of x = %d and Value of y = %d\n",x,y);}

  1. 7,49

  2. 7,42

  3. 7,36

  4. 7,25

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In C, evaluating ++x * ++x (where x starts at 5) is undefined behavior. On many compilers (like GCC), both increments execute before the multiplication, making x become 7, and the multiplication evaluates to 7 * 7 = 49. Although undefined, 7 and 49 is the classic compiler output represented by the stored correct option.