Advertisement
Dianov

Basic Syntax, Conditional Statements and Loops - Lab (11. Multiplication Table 2.0)

Mar 11th, 2021
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 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 MultiplicationTable2._0
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int givenNumber = int.Parse(Console.ReadLine());
  14.             int multiplier = int.Parse(Console.ReadLine());
  15.  
  16.             for (int i = multiplier; i <= 10; i++)
  17.             {
  18.                 Console.WriteLine($"{givenNumber} X {i} = {givenNumber * i}");
  19.             }
  20.  
  21.             if (multiplier > 10)
  22.             {
  23.                 Console.WriteLine($"{givenNumber} X {multiplier} = {givenNumber * multiplier}");
  24.             }
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement