0% found this document useful (0 votes)
15 views

Program No 1

The program asks the user to input three numbers, stores them in variables a, b, and c, and then compares the numbers to determine the largest. It first checks if a is larger than b, and if so compares a to c to find the largest. If b is larger than a, it compares b to c. Finally, if the previous conditions are not met, c must be largest. The program outputs the largest of the three numbers entered by the user.

Uploaded by

pooja
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Program No 1

The program asks the user to input three numbers, stores them in variables a, b, and c, and then compares the numbers to determine the largest. It first checks if a is larger than b, and if so compares a to c to find the largest. If b is larger than a, it compares b to c. Finally, if the previous conditions are not met, c must be largest. The program outputs the largest of the three numbers entered by the user.

Uploaded by

pooja
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

PROGRAM NO.

using System;
using System.Collections.Generic;
using System.Text;

namespace largestno
{
class xx
{
static void Main(string[] args)
{
int a, b, c;
Console.WriteLine("enter first no....");
a=int.Parse(Console.ReadLine());
Console.WriteLine("enter second no....");
b =int.Parse( Console.ReadLine());
Console.WriteLine("enter third no....");
c = int.Parse(Console.ReadLine());
if (a > b)
{
if(a>c)
Console.WriteLine("a is lorgest:"+a);
else
Console.WriteLine("c is lorgest:"+c);
}
else
if(b>c)
{
Console.WriteLine("b is lorgect:"+b);
}
else
Console.WriteLine("c is lorgest:"+c);
}
}
}
Output of the Program:
enter first no....
15
enter second no....
48
enter third no....
72
b is lorgect:72
Press any key to continue . . .

You might also like