answersLogoWhite

0


Best Answer
Copy

#include<stdio.h>

#include<math.h>

void main()

{

float pow = 2.0, nr, dr = 1.0, x1, sum;

int i = 1,n,s = -1,x;

clrscr();

printf("\n\n\t ENTER THE ANGLE...: ");

scanf("%d", &x);

x1 = 3.142 * (x / 180.0);

sum = 1.0;

nr = x1*x1;

printf("\n\t ENTER THE NUMBER OF TERMS...: ");

scanf("%d",&n);

while(i<=n)

{

dr = dr * pow * (pow - 1.0);

sum = sum + (nr / (dr * s));

s = s * (-1);

pow = pow + 2.0;

nr = nr * x1 * x1;

i++;

}

printf("\n\t THE SUM OF THE COS SERIES IS..: %0.3f", sum);

getch();

}

User Avatar

Wiki User

โˆ™ 2008-12-02 06:12:53
This answer is:
๐Ÿ™
0
๐Ÿคจ
0
๐Ÿ˜ฎ
0
๐Ÿ˜‚
0
User Avatar

Add your answer:

Earn +5 pts
Q: C program to find sum of cosine series?
Write your answer...
Submit

Related Questions

Write a program to find the sum of sine series?

Writing a program for a sum of sine series requires a rather long formula. That formula is: #include #include #include main() { int i,n,x; .


What is the assembly program to generate a geometric series and compute its sum The inputs are the base root and the length of the series The outputs are the series elements and their sum?

What is the assembly program to generate a geometric series and compute its sum The inputs are the base root and the length of the series The outputs are the series elements and their sum?


How do you find the sum of nos in a series?

It depends on the series.


Write a program to genarate Fibonacci series upto sum numbers?

Where are the numbers that you want to sum.


What is the Program to find sum of natural number using recursion?

The sum of the natural numbers cannot be found by any method, iterative or not, as the series is infinitely long. Please restate the question.


How do you write an assembly language program to find the sum of n numbers using array?

write an assembly language program to find sum of N numbers


Write a program to find the sum of all positive number and terminate the program when sum exceed 999?

int sum = 0; int n = 0; while( sum &lt;= 999 ) { sum += (++n); }


If two integers have the same sign what is the sine of their sum?

Sine(A+ B) = Sine(A)*Cosine(B) + Cosine(A)*Sine(B).


How do you find the nth partial sum?

The Nth partial sum is the sum of the first n terms in an infinite series.


Writes a c program to find the sum of all integers between 1 and n?

Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11


A c program to generate a series of 1 3 6 10 15 21.?

As you can see, this series is the sum of the sequence: 1, 2, 3, 4, 5, 6. That is to say: 1 + 2 = 3 3 + 3 = 4 6 + 4 = 10 10 + 5 = 15 15 + 6 = 21 To program this in C, you would want a simple incremental counter which would be added to the series sum on each iteration of the loop. { int c = 2; int sum = 1; // loop until you find all the numbers you want while(1) { // increase the running sum to find the next next number in the series sum += c; // increment our counter ++c; } }


What is the Program to find sum of square of n natural numbers in c 3.0?

#include&lt;stdio.h&gt; main() { int i,n,sum = 0; printf("Program to find sum of n natural number\n"); printf("Enter the value of n "); scanf("%d",&amp;n); for (i = 0;i &lt;= n;i++) { sum = sum + i * i; } printf("The sum is %d",sum); }


Write programme for sum of number given?

write a program to find the sum of squares up to 50


How do you write c program to find sum of two numbers?

You add numbers as follows: sum = a + b;


Write a C program to find the cosine and sine series?

//COSINE SERIES #include&lt;stdio.h&gt; #include&lt;conio.h&gt; #include&lt;math.h&gt; main() { int i,n,x; float t,s; clrscr(); printf("enter the value of x,n \n"); scanf("%d%d",&amp;x,&amp;n); t=1; s=1; for(i=1;i&lt;n;i++) { t=(-1)*((pow(x,2)*t*i))/((2*i)*((2*i-1)*i)); s=s+t; printf("s=%6.2f &amp; t=%6.2f\n",s,t); } printf("\n sum of the cos series=%5.2f\n",s); }


Program to find the sum of harmonic series?

Let's assume that you want the sum of the general harmonic series: sum(n=0,inf): 1/(an+b) Since we know that the harmonic series will converge to infinity, we'll also assume that you want the sum from 0 to n. double genHarmonic(const double n, const double a, const double b) { double sum = 0.0; // perform calculations int k; for(k = 0; k &lt;= n; ++k) { sum += 1.0 / (a * k + b); } return sum; }


Write a program to find the sum of squares of the given number?

Algorithm and Flowcharts for a program to compute the sum of the squares of the numbers for a given range used for loop


Write a C program to find sum of 3 matrices?

matrix


Java program to find sum on even numbers from 12-45?

sum = 0; for (int i = 12; i


Write a C program using dynamic memory allocation to find the sum of elements of a matrix?

Did you know that memory allocation is not needed to display the matrix? However, the C program is to find the sum of all the elements.


Write a program to generate the fibonacci series in java?

Set two variables "a" and "b" to the starting number of the Fibonacci series, for example, 1 and 1. Then, repeatedly (i.e., in a loop) set: sum = a + b; b = a; a = sum; ... and print the sum (or equivalently, variable "a").


Write java program for sum of ten numbers?

double[] numsToSum; // the numbers you want to find the sum of double sum = 0.0; for(int i = 0; i &lt; numsToSum.length; ++i) { sum += numsToSum[i]; }


What is a partial sums?

Partial sum is a sum of part of the infinite series. However, series is called a sum of all the terms in infinite series. Hence partial sum is a finite series.


To find LCM of n numbers using 8085 programs?

sample program in sum of the series using the formula for s=n/2[2a+{n-1}d] in 8085


How do you write a program to find the sum of n numbers in an array?

In Java: // This program adds all numbers in the array int sum = 0; for (int i = 0; i < myArray.length(); i++) { sum += myArray[i]; }In Java: // This program adds all numbers in the array int sum = 0; for (int i = 0; i < myArray.length(); i++) { sum += myArray[i]; }In Java: // This program adds all numbers in the array int sum = 0; for (int i = 0; i < myArray.length(); i++) { sum += myArray[i]; }In Java: // This program adds all numbers in the array int sum = 0; for (int i = 0; i < myArray.length(); i++) { sum += myArray[i]; }