aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Java Programming Quiz
  • given x = y--; What will be true after execution?
Multiple choice technology programming languages

given x = y--; What will be true after execution?

  1. x>y

  2. x<y

  3. x==y

  4. x++

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

The post-decrement operator (y--) returns the CURRENT value of y, then decrements y. So if y=5, then x=y-- means x gets 5, and y becomes 4. After execution, x=5 and y=4, so x>y is true. Option A is correct. Option B would mean x

Keep practicing — related questions

  • Consider the following code: int x, y, z; y = 1; z = 5; x = 0 - (++y) + z++; After execution of this, what ...
  • Consider the following code: int x, y, z; y = 1; z = 5; x = 0 - (++y) + z++; After execution of this, what ...
  • Consider the following code: int x, y, z; y = 1; z = 5; x = 0 - (++y) + z++; After execution of this, what ...
  • If x + y > 4 and x < 3, then y > 1 is true. Is this statement true ?
  • Suppose x=10 and y=10 what is x after evaluating the expression (y > 10) && (x++ > 10).
  • What will be the value of y in the following program fragment? int y = 10; If(y++ >9 && y++! = 10 && y++>10)
  • What will be the value of $X if the below statement will be executed? $X = (1 -eq 1) -and (2 -eq 2)
  • NOP sled technique is a popular
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