Answers for "how to find the max b=etween 3number in cpp"

C++
2

how to find the max b=etween 3number in cpp

#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;
}
Posted by: Guest on October-30-2020

Code answers related to "how to find the max b=etween 3number in cpp"

Browse Popular Code Answers by Language