English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The functionisgreater()
used to check if the first parameter is greater than the second parameter. Declared in the C language 'math.h' header file. If successful, it returns true, otherwise it returns false.
This is the syntaxisgreater()
.
bool isgreater(value1 , value2);
Here,
value1-This is the first parameter, which will be compared with the value2Check together.
value2-This is the second parameter, used to check the value1whether it is greater.
This is an exampleisgreater()
.
#include<iostream> #include<math.h> 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; }
Output the result
val1 is greater than val2 : 1
in the above program, the function's functionisgreater()
exists inmain()
in the method. Declare three variables as val1, val2and result. The function is checking the first value val1Whether it is greater than the second value val2. Store it in the variable result.
result = isgreater(val1, val2);