Table of any Number Program in C#


Prev Tutorial Next Tutorial

Table of any Number Program in C#

To calculate or find table of any number we multiply given number bu 1 to 10. For write this code we use given formula.

Formula

Table=num*1;
Table=num*2;
Table=num*3;
...................
...................
Table=num*10;

Calculate Table of any Number Program in C#

using System;

namespace Table_Pro
{
class Program
{
static void Main(string[] args)
{
int num;
Console.WriteLine("Enter any Number for Table: ");
num = Convert.ToInt32(Console.ReadLine());
for (int i = 1; i <= 10; i++)
{
Console.WriteLine("{0}*{1}={2}", num, i, i * num);
}
}
}
}

Output

Enter any Number for Table:5
5*1 =5
5*2 =10
5*3 =15
5*4 =20
5*5 =25
5*6 =30
5*7 =35
5*8 =40
5*9 =45
5*10 =50

Output

Enter any Number for Table: 10
10*1 =10
10*2 =20
10*3 =30
10*4 =40
10*5 =50
10*6 =60
10*7 =70
10*8 =80
10*9 =90
10*10 =100

Prev Tutorial Next Tutorial

Advertisements
Download Projects

Advertisements

Download WhatsApp Status Video

Buy This Ad Space Only $50 per Month, Ad Size 300X250 Contact on: [email protected] WhatsApp no. 8882538826

Google Adsense Advertisements