Answer to Question #343800 in C for Samir parajuli

Question #343800

Write a program to display the multiplication table of the input number.

1
Expert's answer
2022-05-23T15:17:58-0400
using System;
namespace ConsoleApp1
{
  class Program
  {
    static void Main(string[] args)
    {
      string str = "";
      int Number;
      while (str != "Exit" && str != "E" && str != "exit" && str != "e")
      {
        Console.Write("Write a number from 1 to 9 (Or write the Exit): ");
        str = Console.ReadLine();
        if (int.TryParse(str, out Number))
          if (Number >= 1 && Number <= 9)
            for (int i = 1; i <= 9; i++)
              Console.WriteLine(Number + "*" + i + "=" + Number * i);
      }
    }
  }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS