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

Basic calculator using if


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 if block.

Input

4
x
4

Output

4x4= 16

Solution

Flow controls A

1 / 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