INPUT:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TABLE_PRINT
{
class Program
{
static void Main(string[] args)
{
int num;
Console.WriteLine("Write
the table num");
num = Convert.ToInt32(Console.ReadLine());
for (int i = 1; i <= 10; i++)
{
Console.WriteLine("{0}*{1}={2}", num, i, i * num);
}
}
}
}
explain console.WriteLine({0}*{1}={2},num,i,i*num)
ReplyDeleteConsole.WriteLine("enter ur number");
Deleteint n=int.Parse(Console.ReadLine());
int c=0;
for(int i=1;i<=10;i++)
{
C=a*i;
Console.WriteLine(n+"*"+i+"="+c);
}
Console.ReadLine();
}
}
} This also execute for tables
Console.WriteLine("enter ur number");
ReplyDeleteint n=int.Parse(Console.ReadLine());
int c=0;
int a=n;
for(int i=1;i<=10;i++)
{
C=a*i;
Console.WriteLine(n+"*"+i+"="+c);
}
Console.ReadLine();
}
}
} This also execute for tables
Other variable i.e.. int a=n; is optional (or) not required
ReplyDelete