Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Genero 1.25 KB | None | 0 0
  1.             int answer;
  2.             int num1 = 120;
  3.             int num2 = 3;
  4.             char symbol = '/';
  5.             bool tzodek = false;
  6.             Console.WriteLine("Answer The Question Below:\n{0} {1} {2} = ?", num1, symbol, num2);
  7.             answer = int.Parse(Console.ReadLine());
  8.             if (symbol == '+')
  9.             {
  10.                 if (answer == num1 + num2)
  11.                 {
  12.                     tzodek = true;
  13.                 }
  14.             }
  15.             else if (symbol == '-')
  16.             {
  17.                 if (answer == num1 - num2)
  18.                 {
  19.                     tzodek = true;
  20.                 }
  21.             }
  22.             else if (symbol == '*')
  23.             {
  24.                 if (answer == num1 * num2)
  25.                 {
  26.                     tzodek = true;
  27.                 }
  28.             }
  29.             else if (symbol == '/')
  30.             {
  31.                 if (answer == num1 / num2)
  32.                 {
  33.                     tzodek = true;
  34.                 }
  35.             }
  36.  
  37.             if (tzodek == true)
  38.             {
  39.                 Console.WriteLine("To---Oooov!!!");
  40.             }
  41.             else
  42.             {
  43.                 Console.WriteLine("Efes...");
  44.             }
  45.             Console.ReadLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement