how to use floor(),ceil() built in function in C programming!
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <math.h>
int main()
{
float coins = 6.9898;
float pennies = 7.65476;
printf("Coins is : %.2f$\n",floor(coins));
printf("Pennies is : %.2f$\n",floor(pennies));
printf("Coins is : %.2f$\n",ceil(coins));
printf("Pennies is : %.2f$\n",ceil(pennies));
return 0;
}
Comments
Post a Comment