Skip to content

Opening book details…

About this document

C Program for Cosine Series Evaluation by Pawan S is a document available to read on EtoBox.

This C program calculates an approximation of the cosine of an angle x by summing the terms of its Taylor series expansion. The user inputs the angle x in degrees and the number of terms n. The program converts x to radians, initializes the sum to 1 and a term t to 1, then uses a for loop to calculate each term of the series from 1 to n, multiplying t by -1, x squared, and dividing by the factorial of the term number. It prints the final sum as the approximation of cos(x).

Author
Pawan S
Language
EN