Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- public static void Main(string[] args)
- {
- double one = double.Parse(Console.ReadLine());
- char ch = char.Parse(Console.ReadLine());
- double two = double.Parse(Console.ReadLine());
- Console.WriteLine(Mathoperations(one,ch,two));
- }
- public static double Mathoperations(double a,char ch,double b)
- {
- double result = 0.00;
- switch(ch)
- {
- case '+':
- result = a + b;
- break;
- case '-':
- result = a - b;
- break;
- case '*':
- result = a * b;
- break;
- case '/':
- result = a / b;
- break;
- }
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement