English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This functionislessequalr()
used to check if the first parameter is less than or equal to the second parameter. Declared in the "math.h" header file. If successful, it returns true, otherwise it returns false.
This is islessequal()
bool islessequal(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 the value that is less than or equal to1.
This is an example islessequal()
#include<iostream> #include<math.h> using namespace std; int main() { int val1 = 8; int val2 = 8; bool result; result = islessequal(val1, val2); cout << "val1 islessequal than val2 : " << result << endl; return 0; }
Output result
val1 islessequal than val2 : 1
In the above example, two values were compared, one of which was less than or equal to the other. It checks if value1 <value2 || value1 =value2. If any of them (value1 <value2 OR value1 = value2. If true, it will return1. Otherwise, it will return 0.
Now, let's see another example, when value1greater than value2l time,
#include<iostream> #include<math.h> using namespace std; int main() { int val1 = 28; int val2 = 8; bool result; result = islessequal(val1, val2); cout << "val1 islessequal than val2 : " << result << endl; return 0; }
Output result
val1 islessequal than val2 : 0