write c++ programming that accept three different numbers from user and finding the largest from three numbers.if all the three number are equal print out all are equal
Answers
Answered by
0
Answer:
#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 << "all numbers are equal: ";
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;
}
Similar questions
Chemistry,
1 month ago
Chemistry,
1 month ago
Physics,
3 months ago
Social Sciences,
10 months ago
Geography,
10 months ago