Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Rextester.Program.Main is the entry point for your code. Don't change it.
- //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354)
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text.RegularExpressions;
- namespace Rextester
- {
- public class Program
- {
- public static void Main(string[] args)
- {
- //Your code goes here
- start:
- Console.Clear();
- char ArithmeticOperatorIdentifier, opt;
- double x, y, sum, difference, product, quotient, Quotient1_Hindi_Ko_Alam_Ano_Ba_Tatawagin_Dito;
- Console.WriteLine("[+] - Addition");
- Console.WriteLine("[-]) - Subtraction;");
- Console.WriteLine("[*]) - Multiplication;");
- Console.WriteLine("[/]) - Division;");
- Console.WriteLine("[%]) - Modulo Division;");
- Console.WriteLine("^^^Choose Symbol Above for Arithmetic Operator^^^");
- Console.Write("\nEnter your First Number: ");
- x = Convert.ToDouble(Console.ReadLine());
- Console.Write("Enter your Second Number: ");
- y = Convert.ToDouble(Console.ReadLine());
- Console.Write("Enter Arithmetic operator: ");
- ArithmeticOperatorIdentifier = Convert.ToChar(Console.ReadLine());
- if (ArithmeticOperatorIdentifier=='+'){
- sum = x+y;
- Console.WriteLine("The sum of " + x + " and " + y +" is " +sum);
- }
- else if (ArithmeticOperatorIdentifier=='-') {difference = x-y; Console.WriteLine("The difference of " + x + " and " + y +" is " +difference);}
- else if (ArithmeticOperatorIdentifier=='*') {product = x*y; Console.WriteLine("The product of " + x + " and " + y +" is " +product);}
- else if (ArithmeticOperatorIdentifier=='/') {quotient = x/y; Console.WriteLine("The quotient of " + x + " and " + y +" is " +quotient);}
- else if (ArithmeticOperatorIdentifier=='%') {Quotient1_Hindi_Ko_Alam_Ano_Ba_Tatawagin_Dito = x%y; Console.WriteLine("The remainder of " + x + " and " + y +" is " + Quotient1_Hindi_Ko_Alam_Ano_Ba_Tatawagin_Dito);}
- //try again code snippet
- Console.WriteLine("\nDo you want to Continue? Y/N");
- opt = Convert.ToChar(Console.ReadLine());
- switch (opt){
- case 'Y':
- case 'y':
- goto start;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement