VelizarAvramov

10. Multiplication Table 2.0

Jul 17th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.78 KB | None | 0 0
  1. Rewrite you program so it can receive the multiplier from the console. Print the table from the given multiplier to 10. If the given multiplier is more than 10 - print only one row with the integer, the given multiplier and the product. See the examples below for more information.
  2. using System;
  3.  
  4. namespace _10._Multiplication_Table_2._0
  5. {
  6.     class MultiplicationTwo
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             int multiplier = int.Parse(Console.ReadLine());
  11.             int givenStart = int.Parse(Console.ReadLine());
  12.  
  13.             do
  14.             {
  15.                 Console.WriteLine($"{multiplier} X {givenStart} = {multiplier * givenStart}");
  16.                 givenStart++;
  17.             }        
  18.             while (givenStart <= 10);
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment