aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Java and .NET Programming Fundamentals
  • What is the result of the following operation? System.out...
Multiple choice technology programming languages

What is the result of the following operation? System.out.println(4 | 3);

  1. 6

  2. 0

  3. 1

  4. 7

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

The | operator performs bitwise OR: 4 (binary 100) OR 3 (binary 011) = 111 (binary) = 7 (decimal). Each bit position is set to 1 if either operand has a 1 in that position.

Keep practicing — related questions

  • System.out.println(4 | 3);
  • What will be output from the following statements: System.out.println(1+2+"3"); System.out.println("1"+2+3);
  • What will be printed as the result of the operation below: main() { int x=5; printf(“%d,%d,%dn”,x,x< <2,x>>...
  • What will be printed as the result of the operation below: main() { int x=10, y=15; x = x++; y = ++y; print...
  • What will be output from the following statements: System.out.println(1+2+”3”); System.out.println (“1”+2+3);
  • What will be the output of the following statement? System.out.println ("1" + 3);
  • What will be printed as the result of the operation below: main() { int x=20,y=35; x=y++ + x++; y= ++y + ++...
  • Which of the following statements are true?
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Programming Languages and Compilers (2284 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy