Finding maximum number by user defined function

Code of Finding maximum number by user defined function:

// Find Maximum Number

#include<iostream>
using namespace std;
float find_max(float a, float b, float c);
void main()
{
float a, b, c;
cout << "Enter First Number: ";
cin >> a;
cout << "Enter Second Number: ";
cin >> b;
cout << "Enter Third Number: ";
cin >> c;
cout << endl;
cout << "Largest Number is: " << find_max(a, b, c);
cout << endl;
}
float find_max(float a, float b, float c)
{
if (a > b && a > c)
return a;
else if (b > a && b > c)
return b;
else
return c;
}

Download:

To download this code click on the given link below,

Comments

Popular posts from this blog

How to Run Assembly Language Programming Code In Visual Studio 2019

How to Display Table of any Number in Assembly Language

How to Display Character in Assembly language