Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a program to evaluate a mathematical expression in postfix notation (e.g., 5 1 2 + 4 * + 3 -).

Hard

Problem Statement

Write a program to evaluate a mathematical expression in postfix notation (e.g., 5 1 2 + 4 * + 3 -).

Sample Input

Expression: "5 1 2 + 4 * + 3 -"

Sample Output

Result: 14

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
using System; using System.Collections.Generic; class PostfixEvaluation { static void Main() { // Evaluate a postfix expression } }
Log in or sign up to run or submit your code.Log inSign up
Input
Expression: "5 1 2 + 4 * + 3 -"
Expected Output
Result: 14