The sin Function in C programming is one of the Math Library Function, which is used to calculate the Trigonometry Sine value for the specified expression.

In this article we will show you, How to use this SIN function with example.

**TIP : **Please refer ASIN Function article to calculate the Arc Sine of specified expression.

## Syntax of a SIN Function in C

Before we get into to the syntax of a SIN function in C, Let us see the mathematical formula behind this Trigonometry Sine function:

sin(x) = Length of the Opposite Side / Length of the Hypotenuse

The basic syntax of the sin inĀ C Programming is as shown below.

double sin(double number);

**NOTE:** The SIN function in C will return the value between -1 and 1.

## SIN Function in C Example

The sin Function in math library allows you to calculate the trigonometric Sine for the specified values. This program, ask the user to enter his/her own value, and then it will find the sine value of the user specified value

/* Example for SIN Function in C Programming */ #include <stdio.h> #include <math.h> int main() { double sinValue, number; printf(" Please Enter the Value to calculate Sine : "); scanf("%lf", &number); sinValue = sin(number); printf("\n The Sine value of %lf = %f ", number, sinValue); return 0; }

**OUTPUT**

## C SIN Function Example 2

This example allow the user to enter the value in degrees, and then we are converting the degrees to Radians. And finally, we are finding the sine value of the radian

/* Example for SIN Function in C Programming */ #include <stdio.h> #include <math.h> #define PI 3.14159 int main() { double sinValue, radianVal, degreeVal; printf(" Please Enter an Angle in degrees : "); scanf("%lf", °reeVal); // Convert Degree Value to Radian radianVal = degreeVal * (PI/180); sinValue = sin(radianVal); printf("\n The Sine value of %f = %f ", degreeVal, sinValue); return 0; }

**OUTPUT**

Thank You for Visiting Our Blog