Advertisement
Adm1n_0v3rride

The calcuator in C#

Feb 6th, 2018
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.56 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. // calcuator Program in C# (C)2018 Adm1n_0v3rride
  7. namespace SoloLearn
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int choice; // To choose
  14.            
  15.             int a; // For addition
  16.             int b;
  17.             int answer;
  18.            
  19.             int c;// For Subtraction
  20.             int d;
  21.             int e;
  22.            
  23.             int f; // For Multiplication
  24.             int g;
  25.             int h;
  26.            
  27.             int i; // For Divison
  28.             int j;
  29.             int k;
  30.            
  31.             Console.WriteLine("Welcome to the calcuator program v1.0\n");
  32.            
  33.             Console.WriteLine("Please Choose a Option\n");
  34.            
  35.             Console.WriteLine("1. Addition\n");
  36.            
  37.             Console.WriteLine("2. Subtraction\n");
  38.            
  39.             Console.WriteLine("3. Multiplication\n");
  40.            
  41.             Console.WriteLine("4. Divison\n");
  42.            
  43.             Console.WriteLine("Please choose: \n");
  44.            
  45.             choice = Convert.ToInt32(Console.ReadLine());
  46.            
  47.             if(choice == 1) {
  48.                    
  49.                 Console.WriteLine("Please input the First number: \n");
  50.                    
  51.                 Firstnumber = Convert.ToInt32(Console.ReadLine());
  52.                    
  53.                 Console.WriteLine("Please input the Secound number: \n");
  54.                    
  55.                 Secoundnumber = Convert.ToInt32(Console.ReadLine());
  56.                    
  57.                 answer = a + b;
  58.                    
  59.                 Console.WriteLine(" The numbers {0} and {1} equal {2} ",a,b,answer);
  60.                    
  61.                 Console.ReadLine();
  62.                    
  63.             if(choice == 2) {
  64.                
  65.                 Console.WriteLine("Please input the First number: \n");
  66.                    
  67.                 Firstnumber = Convert.ToInt32(Console.ReadLine());
  68.                    
  69.                 Console.WriteLine("Please input the Secound number: \n");
  70.                    
  71.                 Secoundnumber = Convert.ToInt32(Console.ReadLine());
  72.                    
  73.                 e = c - d;
  74.                    
  75.                 Console.WriteLine(" The numbers {0} and {1} equal {2} ",c,d,e);
  76.                    
  77.                 Console.ReadLine();
  78.                
  79.             }
  80.            
  81.             if(choice == 3) {
  82.                
  83.                 Console.WriteLine("Please input the First number: \n");
  84.                    
  85.                 Firstnumber = Convert.ToInt32(Console.ReadLine());
  86.                    
  87.                 Console.WriteLine("Please input the Secound number: \n");
  88.                    
  89.                 Secoundnumber = Convert.ToInt32(Console.ReadLine());
  90.                    
  91.                 h = f * g;
  92.                    
  93.                 Console.WriteLine(" The numbers {0} and {1} equal {2} ",f,g,h);
  94.                    
  95.                 Console.ReadLine();
  96.            
  97.             }
  98.            
  99.             if(choice == 4) {
  100.                
  101.                 Console.WriteLine("Please input the First number: \n");
  102.                    
  103.                 Firstnumber = Convert.ToInt32(Console.ReadLine());
  104.                    
  105.                 Console.WriteLine("Please input the Secound number: \n");
  106.                    
  107.                 Secoundnumber = Convert.ToInt32(Console.ReadLine());
  108.                    
  109.                 h = f / g;
  110.                    
  111.                 Console.WriteLine(" The numbers {0} and {1} equal {2} ",f,g,h);
  112.                    
  113.                 Console.ReadLine();
  114.            
  115.         }
  116.     }
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement