by Dinesh Thakur

This program asks user to find out the cos (Cosine) theta value. Cosine is a trigonometric element that uses in the math function. User defines the PI value for functions user also declares the variables for the required condition. User ask to enter the value for the X. then it’s manipulated by PI and trespass the value to cosz=term and further passes to loop statement for printing out the output for cosine value on to the display.

Problem Statement:

This is C program that asks user to find out the cosine value.

  1. Declare the variables.
  2. Using loop statement.
  3. Display result on the screen.

Here is C source code for finding out the Cosine value. Output of this program shown below.


#define ACC 0.0001
#define PI 3.14
void main()
         int x,i;
         float x1,x2,cosz=0,term;
         printf("Enter the X value:");
         // printf("%f",cos(x1));
                 term = (x2*(-term))/(i*(i-1));
                 cosz = cosz+term;
                 printf("\nNew Value : %f",cosz);
Output :

C Program Write a Program to Find the COS Theta Value

Follow us