A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

Write a C program to demonstrate example of floor() and ceil() functions
Q:

Write a C program to demonstrate example of floor() and ceil() functions

0

C program to demonstrate example of floor() and ceil() functions

This program will demonstrate the example of floor() an ceil() function in c programming language. Both functions are library functions and declare in math.h header file.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Example of floor() and ceil() functions in c

/* C program to demonstrate example of floor and ceil functions.*/
 
#include <stdio.h>
#include <math.h>
 
int main()
{
    float val;
    float fVal,cVal;
 
    printf("Enter a float value: ");
    scanf("%f",&val);
 
    fVal=floor(val);
    cVal =ceil(val);
    printf("floor value:%f \nceil value:%f\n",fVal,cVal);
    return 0;
}

Output

    Enter a float value: 123.45
    floor value:123.000000 
    ceil value:124.000000

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now