1. Course
  2. Flow controls A
  3. Basic calculator using switch

Basic calculator using switch


Last updated: 8/22/2020 Difficulty: Easy

Write a program in C# that asks the user for two numbers and one operation (+, -, x, /) then calculate the operation and display the result on the screen.

Show the text Unrecognized character if the operation symbol is different from the previous ones.

You should use the switch block.

Input

6
-
4

Output

6-4= 2

Solution

Flow controls A

2 / 9

Android App


Practice C# anywhere with the free app for Android devices.

Android App

Exercises C# by difficulty


Learn C# at your own pace, the exercises are ordered by difficulty.

Advertising