
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
Explain important functions in math.h library functions using C language
All mathematical related functions are stored in math.h header file in C programming language. The functions are explained below in detail.
sin()
This function is used to find the sin value of its argument.
The syntax of sin() function is as follows −
double sin(double a);
For example,
double a=sin(3.14/2);
The output is as follows −
a=1 (approx.)
cos()
It is used to find the cos value of its argument.
The syntax for cos() function is as follows −
double cos(double a);
For example,
double a=cos(3.14/2);
The output is as follows −
a=0 (approx.)
tan()
It is used to find the tan value of its argument.
The syntax for tan() function is as follows −
double tan (double a);
For example,
double a=tan(3.14/2);
exp()
It is used to find the exponent value of its argument.
The syntax for exp() is as follows −
double exp (double a);
For example,
double a=exp(4.6);
floor()
It is used to round down a float number.
The syntax for floor() function is as follows −
Double floor(double a);
For example,
Double a=floor(93.58);
The output is as follows −
A=93
ceil()
It is used to round up a float number.
The syntax for ceil() function is as follows −
Double ceil(double a);
For example,
Double a=ceil(93.58);
The output is as follows −
A=94
abs()
It is used to find the absolute value of an integer.
The syntax for abs() function is as follows −
int abs(int a);
For example,
Int a= abs(-6);
The output is as follows −
a=6
pow()
It is used to find the power of a value.
The syntax for pow() function is as follows −
double pow(double a,double b);
For example,
double x=pow(2,3)
The output is as follows −
x=8
sqrt()
It is used to find the square root value of its argument.
The syntax for sqrt() function is as follows −
double sqrt(double a);
For example,
double x=sqrt(36);
The output is as follows −
x=6
- Related Articles
- Explain fgetc() and fputc() functions in C language
- Explain string library functions with suitable examples in C
- Explain the functions putw() and getw() in C language
- Explain unformatted input and output functions in C language
- Explain scope rules related to the functions in C language
- Explain putc() and getc() functions of files in C language
- What are JavaScript Math Functions?
- What are the C library functions?
- Wide char and library functions in C++
- Functions in Rust programming language
- What are the predefined functions in C language?
- What are string searching functions in C language?
- Explain C Error handling functions
- How communication among functions is established in C language?
- Finding alphabet from ASCII value without using library functions in JavaScript
