isgreater() in C/C++

The function isgreater() is used to check that the first argument is greater than the second one or not. It is declared in “math.h” header file in C language. It returns true, if successful, otherwise false.

Here is the syntax of isgreater().

bool isgreater(value1 , value2);


value1 − This is the first argument which will be checked with value2.

value2 − This is the second argument which is used to check value1 that is greater or not.

Here is an example of isgreater().


 Live Demo

using namespace std;
int main() {
   int val1 = 28;
   int val2 = 8;
   bool result;
   result = isgreater(val1, val2);
   cout << "val1 is greater than val2 : " << result << endl;
   return 0;


val1 is greater than val2 : 1

In the above program, the functionality of function isgreater() exists in main() function. Three variables are declared as val1, val2 and result. The function is checking that the first value val1 is greater than second value val2 or not. Which is stored in variable result.

result = isgreater(val1, val2);

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 26-Jun-2020


Kickstart Your Career

Get certified by completing the course

Get Started