skipter

C# Multiplication table

Jun 1st, 2017
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System;
  2. namespace ConsoleApp8
  3. {
  4.     class Program
  5.     {
  6.         static void Main(string[] args)
  7.         {
  8.             int num = int.Parse(Console.ReadLine());
  9.             int stopNum = int.Parse(Console.ReadLine());
  10.  
  11.             if (stopNum > 10)
  12.             {
  13.                 Console.WriteLine("{0} X {1} = {2}", num, stopNum, num * stopNum);
  14.             } else if (stopNum >=1 && stopNum <= 10)
  15.             {
  16.                 for (int i = stopNum; i <= 10; i++)
  17.                  {
  18.                     Console.WriteLine("{0} X {1} = {2}", num, i, num * i);
  19.                 }
  20.             }
  21.            
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment