Advertisement
ajreuri23

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

Oct 1st, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 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.             string name;
  16.             Console.WriteLine ("Type Multiplier for multiply action or Add for adding action");
  17.              name = Console.ReadLine ();
  18.             if (name == "Multiplier")
  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 (name == "Add")
  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
  33.                 Console.WriteLine ("You didnt type Add or multiplier");
  34.  
  35.             Console.ReadLine ();
  36.             goto Start;
  37.             }
  38.        
  39.         }
  40.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement