C. Compare
Problem Setup
- login to CS50 IDE
- write
cdin the terminal to go to the home directory - write
mkdir compareto create a folder calledcompare - write
cd compareto go to thecomparefolder - write
code compare.cppto create a file calledcompare.cppand open it in the editor
Problem
Given 2 numbers \(a\) and \(b\). Compare them and determine if \(a\) is greater than \(b\), less than \(b\), or equal to \(b\).
Input
One line containing two integers \(a\) and \(b\) where \(-10^3 \leq a, b \leq 10^3\).
Output
Print the result of the comparison:
Greaterif \(a > b\)Lessif \(a < b\)Equalif \(a = b\)
Examples
Example 1:
Input:
5 1
Output:
Greater
Example 2:
Input:
5 5
Output:
Equal
Example 3:
Input:
4 9
Output:
Less
Test Your Code
Make sure you are in the compare directory, then run the following command:
check50 iti-technical-team/problemset/2026/1/compare
Submit Your Code
Make sure you are in the compare directory, then run the following command:
submit50 iti-technical-team/problemset/2026/1/compare