Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _11.MathOperations
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- double numberOne = double.Parse(Console.ReadLine());
- char calculationType = char.Parse(Console.ReadLine());
- double numberTwo = double.Parse(Console.ReadLine());
- CalculationType(numberOne, calculationType, numberTwo);
- }
- static void CalculationType(double numberOne, char calculationType, double numberTwo)
- {
- if (calculationType == '+')
- {
- double result = numberOne + numberTwo;
- Console.WriteLine(result);
- }
- else if (calculationType == '-')
- {
- double result = numberTwo - numberOne;
- Console.WriteLine(result);
- }
- else if (calculationType == '*')
- {
- double result = numberOne * numberTwo;
- Console.WriteLine(result);
- }
- else if (calculationType == '/')
- {
- double result = numberOne / numberTwo;
- Console.WriteLine(result);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement