How to use isgreater() function to check whether x is greater than y in C

1 Answer

0 votes
#include <stdio.h>     
#include <math.h>
 
int main(int argc, char **argv)
{	
	if (isgreater(1.1, 1.2))
		printf("isgreater(1.1, 1.2) = true\n");
	else
		printf("isgreater(1.1, 1.2) = false\n");
	if (isgreater(3.14, 3.13))
		printf("isgreater(3.14, 3.15) = true\n");
	else
		printf("isgreater(3.14, 3.15) = false\n");		
	
    return 0;
}

/*
run:
  
isgreater(1.1, 1.2) = false
isgreater(3.14, 3.15) = true

*/

 



answered Mar 19, 2016 by avibootz
...