open a console application project in c# language in your editor and just paste the following code in your class's brackets -
static void Main(string[] args) {
int tempNum, number1, number2;
Console.Write("Enter First Number: ");
number1 = int.Parse(Console.ReadLine());
Console.Write("Enter Secnd Number: "); number2 = int.Parse(Console.ReadLine());
Console.WriteLine("\n");
for (tempNum = 1; ; tempNum++)
{
if (tempNum % number1 == 0 && tempNum % number2 == 0)
{
Console.WriteLine("L.C.M is - "); Console.WriteLine(tempNum.ToString());
Console.Read();
break;
}
}
}
Output is -
Friday, March 26, 2010
Subscribe to:
Post Comments (Atom)
This comment has been removed by a blog administrator.
ReplyDeletetest comment
ReplyDelete