# sin in c

## What is sin in c programming?

sin in c is a mathematical function which is used to find sine of a given number.

This function is defined in math.h header file.

### Prototype

``````#include<math.h>
double sin(double y);``````

### Parameters

sin function takes floating point value as angle in radians.

### Return value

This function returns sine of a given number.

## Example program for sin in c

``````#include <stdio.h>
#include <math.h>
#define PI 3.14
int main()
{
double x, res, val1;
x=25.0;
val1=PI/180;
res=sin(x*val1);
printf("The sine of %lf is %lf degrees", x, res);
return 0;
}``````

``gcc file_name.c -lm``

### Code explanantion

The variable val1 is defined in terms of degrees. The number is passed to the sin function and it is multiplied by variable to get sine value in terms of degrees. The result is being printed onto the console.

## Difference between sin and sinh in c

sin in c is a mathematical function that is used to find the sine of a given number. sinh in c is used to find the hyperbolic sine of a given number.

Prototypes are as follows

``````double sin(double y);

double sinh(double y);``````

## Difference between sin and cos in c

sin in c is a mathematical function that is used to find the sine of a given number. cos is a mathematical function that is used to find the cosine of a given number.

Prototypes are as follows

``````double sin(double y);

double cos(double y);``````

## Difference between sin and tan in c

sin in c is a mathematical function that is used to find the sine of a given number. tan is a mathematical function that is used to find the tangent of a given number.

Prototypes are as follows

``````double sin(double y);

double tan(double y);``````