Write a c++ program to find greatest among 3 number
Answers
Answered by
1
Answer:
I hope it's help you
follow mee..
please mark me as brainlist
Explanation:
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;
}
Output
Enter three numbers: 2.3
Enter three numbers: 2.38.3
Enter three numbers: 2.38.3-4.2
Enter three numbers: 2.38.3-4.2Largest number: 8.3
Similar questions