#include <stdio.h>
int COMPOSITENUM(double num)
{
double n; // declare
printf("Enter the value of n : "); // ask
scanf("%lf",&n); // get n from user
if(n == num)
return 0;
else if(num < n)
return -1;
else
return 1;
}
int main(void) {
if(COMPOSITENUM(56.7) == 0)
printf("\nBoth numbers are same");
else if(COMPOSITENUM(56.7) == -1)
printf("\nnum is less than n");
else if(COMPOSITENUM(56.7) == 1)
printf("\nnum is greater than n");
return 0;
}
Output:
Enter the value of n : 56.7 Both numbers are same
Do ask if any doubt.
Get Answers For Free
Most questions answered within 1 hours.