Skip to content

Instantly share code, notes, and snippets.

@aligalehban
Created June 21, 2018 04:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aligalehban/6489d745cdbba9b5398587434cf43502 to your computer and use it in GitHub Desktop.
Save aligalehban/6489d745cdbba9b5398587434cf43502 to your computer and use it in GitHub Desktop.
Find Largest Number in c++ source code - www.alighalehban.com
#include <iostream>
using namespace std;
int main()
{
float n1, n2, n3;
cout << "Enter three numbers: ";
cin >> n1 >> n2 >> n3;
if(n1 >= n2 && n1 >= n3)
{
cout << "Largest number: " << n1;
}
if(n2 >= n1 && n2 >= n3)
{
cout << "Largest number: " << n2;
}
if(n3 >= n1 && n3 >= n2) {
cout << "Largest number: " << n3;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment