SHOW:
|
|
- or go back to the newest paste.
| 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++) |
| 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 | } |