Skip to main content

WAP to find largest number among 3 numbers

 using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;
namespace greatest
{
Class Program
{
static void main(string[] args)
{
double a, b, c;
Console.WriterLine("Please input three numbers.");
a=Convert.Toint32(Console.ReadLine());
b=Convert.Toint32(Console.ReadLine());
c=Convert.Toint32(Console.ReadLine());
if(a>b && a>c)
{
Console.WriteLine("The greatest number is:{0}",a);
}
else if (b>a && b>c)
{
Console.WriteLine("The greatest number is:{0}",b);
}
else
{
Console.WriteLine("The greatest number is: {0}",c);
}
Console.ReadLine();
}
}
}


OUTPUT:
Please input three numbers. 
5
6
7
The greatest number is: 7











Comments

Popular posts from this blog

Physical variables and transducer

unit 3 Physical Variables and transducers  Sensor Sensors are electrical devices that have the capability of sensing different physical variables. The sensor may be classified on different bases one of them is a physical quantity. Hence on the basis of a physical quantity or physical vibration involved the sensors are classified as: Resistive sensor  The input being measured is transformed into a change in resistance. examples: potentiometer, resistance thermometer, strain gauge, etc. Inductive sensor The input being measured is transformed into a change in resistance. example LVDT. Capacitive Sensor The input being measured is transformed into a change in capacitance. example: capacitive Displacement sensor. On the basis of power supply required: Active Sensor Active sensors are those which do not require an external power supply.  example: thermo-couple Passive Sensor Passive Sensors are those which require a power supply. example: Potentiometer. Physical variables and ...