- Related Questions & Answers
- Explain Memory allocation functions in C language
- 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 the C library functions?
- Wide char and library functions in C++
- Explain C Error handling functions
- Functions in Rust programming language
- What are the predefined functions in C language?
- Explain Generator functions in JavaScript?
- Explain shorthand functions in JavaScript?
- How communication among functions is established in C language?

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

All mathematical related functions are stored in math.h header file in C programming language. The functions are explained below in detail.

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.)

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.)

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);

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);

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

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

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

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

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

Advertisements