C# Program to print table of any number
In this program, You will learn how to print a table of any number in C#.
14 28 42 56 70 84 98 112 126 140
Example: How to print a table of any number in C#.
using System;
public class Test
{
public static void Main(string[] args)
{
int n, i, t = 0;
Console.Write("Enter a number:");
n = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Table is:");
for (i = 1; i <= 10; i++)
{
t = n * i;
Console.WriteLine(t);
}
}
}
Output:
Enter a number:13
Table is:
13
26
39
52
65
78
91
104
117
130