Precedence Puzzle
C
Easy
3 views
Problem Description
Write the expression: a = 5, b = 10, c = 15; result = a + b * c / 5 - 2 % 3; calculate manually, following operator precedence. Then verify with the program.
Official Solution
#include <stdio.h>
int main() {
int a = 5, b = 10, c = 15;
int result;
result = a + b * c / 5 - 2 % 3;
printf("Result = %dn", result);
return 0;
}
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!