Skip to content
Menu
Code for Java c
  • Home
  • Java
    • Java Examples
    • Java tutorials
  • C
    • C tutorials
    • C Examples
  • C++
    • C++ Tutorials
    • C++ Examples
  • Python
    • Python Tutorials
    • Python Examples
  • About
    • About me
    • contact us
    • disclaimer
    • Privacy Policy
Code for Java c

Arithmetic function in C programming language

Posted on March 5, 2017January 22, 2020

Table of Contents

  • Arithmetic function in C programming language
    • Arithmetic function in C
    • Suggested for you

Arithmetic function in C programming language

In this tutorial, we will discuss the arithmetic function in C programming language

         The arithmetic function is used for the mathematical purpose in C Language
  • C programming language contains a lot of header files for various purposes.
  • One of the header file  #include<math.h>, is used to perform methamatical operations in a program called  math function or arithmatic function.
  • Some of the example of arithmatic functions for abs(), floor(), round(), ceil(), sqrt(), exp(), log(), sin(), cos(), tan(), pow() and trunc()are explaind below.
  • “math.h” and “stdlib.h” header files support all the arithmetic functions in C Language.

Arithmetic function in C

abs(): This function returns the absolute value of only an integer.The absolute value of a number is always positive. abs() maths function supports only integer value in C language. It does not support any datatype – float(fabs), double . This function includes #include<stdlib.h> header file.

Syntex
int abs(int value);

floor(): This functions opposite of th ceil function. It returns the nearest integer value which is less than or equal to the passing argument of this function(rounds dawns the nearest integer). This function includes #include<math.h> header file

Syntex
double floor(double value);

ceil() : This function is oposite of the floor function. It returns nearest and smallest integer value that is greater than or equal(not less than) to the passing argument of this function. This function includs #include<math.h> header file

Syntex
double ceil(double value);

round() :This function returns the nearest integer value of the float or double or lond ,double passing the argument to the function.This function include #include<math.h> header file

Syntex
double round(double value);

sin() : This function is used to calculate sine value.This function includes #include<math.h> header file

Syntex
double sin(double value);

cos() : Thid function is used to calculate cosine value.This function includes #include<math.h> header file

Syntex
double cos(double value);

cosh() : Thid function is use to calculate hyperbolic cosine value.This function includes #include<math.h> header file

Syntex
double cosh(double value);

exp() : This function is use to  calculate the exponential “e” to the nth power.This function includes #include<math.h> header file

Syntex
double exp(double value);

tan() : This function is use tocalculate tangent.This function includes #include<math.h> header file

Syntex
double tan(double value);

tanh() : This function is used to perform  hyperbolic tangent. This function includes #include<math.h> header file

Syntex
double tanh(double value);

sinh() : This function is used to calculate tangent. This function includes #include<math.h> header file

Syntex
double sinh(double value);

log(): This function is used to calculate natural logarithum. This function include s#include<math.h> header file

Syntex
double log(double value);

log10() :  This function is used to calculate base 10 logarithum. This function includes #include<math.h> header file

Syntex
double log10(double value);

sqrt() : This function is used to find the sqaure root of the argument passed to this function. This function includs   #include<math.h> header file. This function includes #include<math.h> header file

Syntex
double sqrt(double value);

pow() : This is used to find the power of the given number. This function includes in #include<math.h> header file

Syntex
double pow(double value1, double value2);

trunc() : This function truncates the decimal value from floating point value and returns an integer value.. This function includes #include<math.h> header file

Syntex
trunc(number,[decimal_places]);

 

Suggested for you

Function in C language

String function in C language

String function in C language with example

Math function in Python

String function in Python

 

 

Related

Recent Posts

  • Subtract two numbers using method overriding
  • PHP Star triangle Pattern program
  • Using function or method to Write temperature conversion : Fahrenheit into Celsius
  • Function or method:temperature conversion from Fahrenheit into Celsius – Entered by user
  • Write temperature conversion program: Fahrenheit into Celsius
  • How to write a program to convert Fahrenheit into Celsius

tag

Addition (6) Array (38) C++ language (91) C language (98) c sharp (23) Division (6) Function (29) if else (32) Java language (102) JavaScript (5) loops (137) Multiply (7) Oop (2) patterns (65) PHP (13) Python Language (38) Subtraction (7) temperature (20)

Archives

Categories

Address

Global information technology

Puloly south, PointPedro

Jaffna

Srilanka

©2025 Code for Java c | Powered by SuperbThemes