aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Programming Fundamentals
  • int x = 3; if( x == 2 ) x = 0; if( x == 3 ) x++; else x +...
Multiple choice

int x = 3; if( x == 2 ) x = 0; if( x == 3 ) x++; else x += 2;
What value will x contain when the above sample code is executed?

  1. 1

  2. 2

  3. 3

  4. 4

  5. 5

Reveal answer Fill a bubble to check yourself
A Correct answer

Keep practicing — related questions

  • x = 3, counter = 0; while ((x-1)) { ++counter; x--; } Referring to the sample code above, what will be the ...
  • int x = 0; for ( ; ; ) { if (x++ == 4) break; continue; } printf(x=%dn, x); What will be printed when the s...
  • int x = 2 * 3 + 4 * 5; What will be the value of x in the sample code?
  • int x = 0; for (x=1; x<4; x++); printf(x=%dn, x); What will be the output of the sample code given above?
  • int n = 0; for ( ; ; ) { if (n++ == 5) break; continue; } printf("x=%d\n", x); What will be printed when th...
  • What is the output?int i = 3;if (!i) i++; i++;if (i==3) i+=2; i+=2;printf("%d\n", i);
  • In which of the following code fragments the variable ‘x’ is evaluated to 810 int x; a) x=32; b) x=16; c) x...
  • What will be the value of $X if the below statement will be executed? $X = (1 -eq 1) -and (2 -eq 2)
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Programming Output Evaluation (1721 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy