Advertisement
YavorGrancharov

Multiplication_Table_2._0

May 27th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Multiplication_Table_2._0
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var n = int.Parse(Console.ReadLine());
  14.             var y = int.Parse(Console.ReadLine());
  15.            
  16.             for (int i = 1; i <= 10; i++)
  17.             {
  18.                 if (y == 1)
  19.                 {
  20.                     Console.WriteLine($"{n} X {i} = " + n * i);
  21.                 }
  22.  
  23.                 else if(y > 1 && y <= 10)
  24.                 {
  25.                     Console.WriteLine($"{n} X {y} = " + n * y);
  26.                     y++;
  27.                 }
  28.             }
  29.  
  30.             if(y > 11)
  31.             {
  32.                 Console.WriteLine($"{n} X {y} = " + n * y);
  33.             }            
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement