Answer to Question #318706 in C++ for John

Question #318706

The Greater One

by CodeChum Admin


Let us now try comparing two numbers by letting the user input two different numbers and say "Greater" if the first inputted number is greater than the second one, and "Lesser" if it’s the other way around.




Let's go!


Input


A line containing two different numbers separated by a space.


1.2·1.02

Output


A line containing a string.


Greater


1
Expert's answer
2022-03-28T14:29:07-0400
#include <iostream>
using namespace std;


int main() {
    double d1, d2;


    cin >> d1 >> d2;
    if (d1 > d2) {
        cout << "Greater";
    }
    else {
        cout << "Lesser";
    }
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS