Advertisement
ajreuri23

מחשבון חיבור חיסור כפל חילוק

Oct 1st, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.64 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ShacharDaKing
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.  
  13.            Start:
  14.             int a, b;
  15.             char sup;
  16.             Console.WriteLine("Type 1 for Adding Or Type 2 For Multiplier Or Type 3 For Dividing Or Type 4 For Removing");
  17.             sup = char.Parse(Console.ReadLine());
  18.             if (sup == '1')
  19.             {
  20.                 Console.WriteLine("Type 2 Numbers");
  21.                 a = int.Parse(Console.ReadLine());
  22.                 b = int.Parse(Console.ReadLine());
  23.                 Console.WriteLine(a + b);
  24.             }
  25.             else if (sup == '2')
  26.             {
  27.                 Console.WriteLine("Type 2 Numbers");
  28.                 a = int.Parse(Console.ReadLine());
  29.                 b = int.Parse(Console.ReadLine());
  30.                 Console.WriteLine(a * b);
  31.             }
  32.             else if (sup == '3')
  33.             {
  34.                 Console.WriteLine("Type 2 Numbers");
  35.                 a = int.Parse(Console.ReadLine());
  36.                 b = int.Parse(Console.ReadLine());                
  37.                 Console.WriteLine(a / b);
  38.             }
  39.             else if (sup == '4')
  40.             {
  41.                 Console.WriteLine("Type 2 Numbers");
  42.                 a = int.Parse(Console.ReadLine());
  43.                 b = int.Parse(Console.ReadLine());
  44.                 Console.WriteLine(a - b);
  45.             }
  46.             else
  47.                 Console.WriteLine("You didnt type the required options");
  48.             Console.ReadLine();
  49.             goto Start;
  50.         }
  51.  
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement