17. whileloop in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace whileloop.cs
{
class Program
{
static void Main(string[] args)
{
int no;
Console.WriteLine("Enter any number = ");
no = Convert.ToInt32(Console.ReadLine());
int i = 1;
while (i <= 10)
{
Console.Write("{0} X {1} = {2}", no, i, no * i);
i++;
}
Console.Read();
}
}
}
OUTPUT:
Enter any number = 11
11 X 1 = 11
11 X 2 = 22
11 X 3 = 33
11 X 4 = 44
11 X 5 = 55
11 X 6 = 66
11 X 7 = 77
11 X 8 = 88
11 X 9 = 99
11 X 10 = 110
Comments
Post a Comment