Geeksforgeeks

Error

×

Leaderboard

Showing:

Handle | Score |
---|---|

@Ibrahim Nash | 6420 |

@blackshadows | 6376 |

@mb1973 | 5604 |

@Quandray | 5231 |

@akhayrutdinov | 5111 |

@saiujwal13083 | 4510 |

@sanjay05 | 3762 |

@kirtidee18 | 3673 |

@marius_valentin_dragoi | 3522 |

@sushant_a | 3459 |

@verma_ji | 3413 |

Complete Leaderboard | |

Handle | Score |

@codersgroup18 | 799 |

@sriramgoparaju99 | 737 |

@Manikanta punnam | 629 |

@rdakka | 606 |

@prankursharma31 | 597 |

@praveenbgp6 | 546 |

@sanskar94511 | 531 |

@purohitmn02 | 525 |

@yashkaril4 | 517 |

@abhikarshgupta | 474 |

@rohitgarg2825 | 464 |

Complete Leaderboard |

Given an integer N. Your task is to check if the integer is greater than, less than or equal to 5.

If the integer is greater than 5, then print "Greater than 5" (without quotes).

If the integer is less than 5, then print "Less than 5".

If the integer is equal to 5, then print "Equal to 5".

**Example 1:**

Input:N = 8Output:Greater than 5

**Example 2:**

Input:N = 4Output:Less than 5

**Your Task:**

You don't need to read input or print anything. Your task is to complete the function compareFive() which takes the number N and returns "Greater than 5" if the integer is greater than 5 or "Less than 5" if the integer is less than 5 otherwise print "Equal to 5" if the integer equals to 5.

**Expected Time Complexity:** O(1)

**Expected Auxiliary Space: **O(1)

**Constraints:**

1 <= N <= 100000

Login to report an issue on this page.

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes
C++ if-else (Decision Making)

...