Guest User

Untitled

a guest
Jun 25th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.15 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Caclulator
  7. {
  8.     class Program
  9.     {
  10.         static void Main()
  11.         {
  12.             int num1;
  13.             int num2;
  14.             string tempnum1;
  15.             string tempnum2;
  16.  
  17.             Console.WriteLine("Please enter your first number");
  18.             tempnum1 = Console.ReadLine();
  19.             num1 = int.Parse(tempnum1);
  20.             Console.WriteLine("Please enter your second number");
  21.             tempnum2 = Console.ReadLine();
  22.             num2 = int.Parse(tempnum2);
  23.  
  24.             Console.WriteLine("Your numbers are "+ num1 +" and "+ num2);
  25.             Console.WriteLine("What would you like to do?");
  26.             Console.ReadLine();
  27.  
  28.             string choice = Console.ReadLine();
  29.             int sum = (num1 + num2);
  30.             switch(choice)
  31.             {
  32.                 case "add":
  33.                 case "+":
  34.                     Console.WriteLine("Your sum is: " + sum); // <- It doesn't display this in console //when it should.
  35.                     Console.ReadLine();
  36.                     break;
  37.             }
  38.  
  39.         }
  40.     }
  41. }
Add Comment
Please, Sign In to add comment