- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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);
Here,
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().
Example
#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
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);
Advertisements