aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Programming Languages Fundamentals Quiz
  • What will be the result of the expression a % b when a an...
Multiple choice technology programming languages

What will be the result of the expression a % b when a and b are of type int and their values are a = 10 and b = 6?

  1. 1.66

  2. 4

  3. 1

  4. None of these

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

The % operator returns remainder of division. 10 / 6 = 1 remainder 4. Therefore 10 % 6 = 4. This is the modulo operation.

Keep practicing — related questions

  • What will be the result of the expression a % b when a and b are of type int and their values are a = -17 a...
  • If p and q are int type variables, what will be the result of the following expression? p % q Where p = - 1...
  • If m = -16 and n = -5 (m and n are int types), the result of the expression m%n is
  • What is the value of a & b after the following two statements are executed? int a=10; int b=a++ * ++a;
  • Suppose a, b and c are integer variables assigned values 8, 3 and -5 respectively. In this case, the respec...
  • The value of the expression [2.5 + 3.2 - 1.4 - {0.2 - (1.3 + 2.5 - 1.2)}] will be
  • If a = -11 & b = -3, what is the value of a % b?
  • NOP sled technique is a popular
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy