Question 91
What is the output of the following C program?
C
#include <stdio.h>
int main(void) {
int a = 5, b = 2;
printf("%d", a / b + a % b);
return 0;
}Detailed Solution
Integer division 5 / 2 = 2. Modulo remainder 5 % 2 = 1. Total sum = 2 + 1 = 3.
✓ Saved