English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

C / C ++의 isgreaterequal()

This functionisgreaterequal()used to check if the first parameter is greater than or equal to the second parameter. Declared in the C language "math.h" header file. Returns true if successful, otherwise returns false.

This isislessgreater()C ++language syntax,

bool isgreaterequal(value1 , value2);

Here,

value1-This is the first parameter, which will be compared with value2together check.

value2-This is the second parameter, used to check value1greater than or equal.

This isisgreaterequal()C ++language example,

Example

#include<iostream>
#include<math.h>
using namespace std;
int main() {
   int val1 = 28;
   int val2 = 8;
   bool result;
   result = isgreaterequal(val1, val2);
   cout << "val1 isgreaterequal greater than val2 : " << result << endl;
   return 0;
}

output result

val1 isgreaterequal greater than val2 : 1

In the above example, two values were compared, one of which was less than or greater than the other. It checks value1> value2 || 值1 =值2. If one of them (value1> value2 OR value1 = value2)is true, then it will return1. Otherwise, it will return 0.

Now, let's look at another example, when the first value is less than the second value,

Example

#include<iostream>
#include<math.h>
using namespace std;
int main() {
   int val1 = 5;
   int val2 = 8;
   bool result;
   result = isgreaterequal(val1, val2);
   cout << "val1 isgreaterequal greater than val2 : " << result << endl;
   return 0;
}

This is the output,

output result

val1 isgreaterequal greater than val2 : 0