sin function(Sine) in C Language – example and detail

In the C Programming Language, the sin characteristic returns the sine of x.

Syntax

The syntax for the sin feature in the C Language is:

double sin(double x);

Parameters or Arguments

x

A value expressed in radians (not degrees).

Returns

The sin function returns the sine of x, measured in radians.

Required Header

In the C Language, the required header for the sin characteristic is:

#include <math.h>

Applies To

In the C Language, the sin function can be used in the following versions:

ANSI/ISO 9899-1990

sin Example

/* Example using sin by TechOnTheNet.com */

#include <stdio.h>
#include <math.h>

int main(int argc, const char * argv[])
{
    /* Define temporary variables */
    double value;
    double result;

    /* Assign the value we will find the sin of */
    value = 0.5;

    /* Calculate the Sine of value */
    result = sin(value);

    /* Display the result of the calculation */
    printf("The Sine of %f is %f\n", value, result);

    return 0;
}

When compiled and run, this software will output:

The Sine of 0.500000 is 0.479426

Similar Functions

Other C features that are similar to the sin function:

acos characteristic asin feature atan function atan2 feature cos characteristic tan feature