Created
June 21, 2018 04:25
-
-
Save aligalehban/6489d745cdbba9b5398587434cf43502 to your computer and use it in GitHub Desktop.
Find Largest Number in c++ source code - www.alighalehban.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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