Advertisement
veselka_a

TestMultiplicationTableKnowlages

Nov 28th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApplication1
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         { //Multiplication table.
  9.  
  10.             Console.WriteLine("Please insert the number you want to practise [1...9] : ");
  11.             Int32 n = Int32.Parse(Console.ReadLine());
  12.          
  13.             for (int i = 1; i < 10; i++)
  14.             {
  15.                 Console.Write("{0} * {1} = ", i, n);
  16.                 int result = Int32.Parse(Console.ReadLine());
  17.                 if (result == i * n)
  18.                 {
  19.                     Console.WriteLine("True!");
  20.                 }
  21.                 else
  22.                 {
  23.                     Console.WriteLine("False!");
  24.                 }
  25.                
  26.            }
  27.  
  28.          }
  29.     }
  30.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement