Cnvmendoza

Highest number

Oct 24th, 2021 (edited)
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.15 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main(){
  4.     float input1, input2, input3;
  5.     cout << "Enter First Number : ";
  6.     cin >> input1;
  7.     cout << "Enter Second Number : ";
  8.     cin >> input2;
  9.     cout << "Enter Third Number : ";
  10.     cin >> input3;
  11.     cout << "Input numbers are : " << input1 << " " << input2 << " " << input3 << endl;
  12.     if (input1==input2 && input2==input3)
  13.         cout << input1 << ", " << input2 << ", " << " and " << input3 << " are all equal to each other.";
  14.     else if (input1>input2 && input3==input1)
  15.         cout << "First number and Third number are both the highest numbers.";
  16.     else if (input2>input1 && input3==input2)
  17.         cout << "Second number and Third number are both the highest numbers.";
  18.     else if (input1>input3 && input2==input1)
  19.         cout << "First number and Second number are both the highest numbers.";
  20.     else if (input1>input2 && input1>input3)
  21.         cout << input1 << " is the highest number among the input numbers.";
  22.     else if (input2>input3 && input2>input1)
  23.         cout << input2 << " is the highest number among the input numbers.";
  24.     else if (input3>input1 && input3>input2)
  25.         cout << input3 << " is the highest number among the input numbers.";
  26. }
Add Comment
Please, Sign In to add comment