aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Programming - 2
  • If a = -11 & b = -3, what is the value of a % b?
Multiple choice

If a = -11 & b = -3, what is the value of a % b?

  1. -3

  2. -2

  3. 2

  4. 3

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

In C99 and later, the result of the % operator with negative operands follows the sign of the dividend. -11 % -3: -11 = (-3 * 3) + (-2). The remainder is -2.

Keep practicing — related questions

  • What is the value of (- 2) + 2 + (- 2) + 2 + (- 2)?
  • What is the value of 2 + (- 2) + 2 + (- 2) + 2 + (- 2)?
  • A, B and C were partners sharing profits in the ratio 5 : 4 : 1. 'A' retired and new ratio was decided as 3...
  • Match the following: | || |---|---| |Organisms|Organs for excretion| |a. Earthworm|1. Malpighian tubules| |...
  • What will be the output of the following code snippet? main() { int a=11,b; clrscr(); for(a%10;a++); printf...
  • Directions: For the word given above the table, match the dictionary definitions on the left (1, 2, 3, 4) w...
  • What will be the output of the program? class Bitwise { public static void main(String [] args) { int x = 1...
  • Arrange the following characters in ascending order according to their ASCII value. b, A, (z-A), 0, Z
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy