C++ Program to Find Largest Number Among Three Numbers

Find maximum number using c++ :C++ Program to Find Largest Element.This program takes n number of element from user (where, n is specified by user) and stores data in an array. Then, this program displays the largest element.we Find Number in C++.

C++ Program to Find Largest Number Among Three Numbers

#include<iostream>
#include<conio.h>
using namespace std;
main()
{
float a,b,c,max;
cout<<"Enter first value:";
cin>>a;
cout<<"Enter second value:";
cin>>b;
cout<<"Enter third value:";
cin>>c;
max=a;
if(max<b)
max=b;
if(max<c)
max=c;
cout<<"maximum value is:"<<max;
getch();
}

Output of Program

Enter first value:5
Enter second value:60
Enter third value:45
Maximum value is:60