Evaluate Expression

Easy Operators & Expressions
Solve in Playground →

Problem Statement

Write a C program to evaluate the arithmetic expression: Result = (A + B) * C / D – E, using integer arithmetic.

Input Format

Five space-separated integers A, B, C, D, and E (D != 0).

Output Format

Print the final integer result.

Constraints

-1000 <= A, B, C, D, E <= 1000, D != 0

Sample Input

2 3 4 2 1

Sample Output

9

Explanation

(2 + 3) * 4 / 2 - 1 = 5 * 4 / 2 - 1 = 20 / 2 - 1 = 10 - 1 = 9.

Starter Code

#include <stdio.h>

int main() {
    int a, b, c, d, e;
    if (scanf("%d %d %d %d %d", &a, &b, &c, &d, &e) == 5) {
        // Write your code here
    }
    return 0;
}

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used