Subscribe For Free Updates!

We'll not spam mate! We promise.

Sunday, 26 August 2012

C++ code to displaying maximum numbers between 3 inputs


// Displaying maximum numbers between 3 inputs
// Programmer name: Sohail ahmed
// Dated: 19/05/2010

#include<iostream.h>
#include<conio.h>

void max_num(float,float,float);

int main()
{
clrscr();
float num_1, num_2, num_3;
cout<<"\nEnter 1st number: ";
cin>>num_1;
cout<<"\nEnter 2nd number: ";
cin>>num_2;
cout<<"\nEnter 3rd number: ";
cin>>num_3;
max_num(num_1,num_2,num_3);
getch();
return 0;
}
void max_num(float num_1, float num_2,float num_3)
{
if(num_1>num_2)
{
cout<<"\n1st number is largest";
}
else if(num_2>num_3)
{
cout<<"\n2nd number is largest";
}
else if(num_3>num_1)
{
cout<<"\n3rd number is largest";
}
}

Socializer Widget By CodingLovers
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment