Q. What will this code output?
Code:
#include <stdio.h>
int main() {
int a = 5 / 2;
printf("%d", a);
return 0;
}
β
Correct Answer: (B)
2
Explanation: Integer division in C truncates the decimal part. 5 / 2 = 2.