jituTechnology

jituTechnology

Write a program to calculate the sum of cosine series

Write a program to calculate the sum of cosine series
Programmed by : kiran shrestha
roll no. : 10121
Programmed on : 6th feb,2011*/
#include <stdio.h>
#include <conio.h>
#include <math.h>
void main ()
{
  int i,j,n;
  float sum=0,fact=1,x;
  printf (“enter terms = “);
  scanf (“%d”,&n);
  printf (“enter the angle of x = “);
  scanf (“%f”,&x);
   x =(x*22)/(7*180);
  for (i=1;i<=n;i++)
     {
     for (j=1;j<=2*i-2;j++)
   {
     fact *=i;
      sum += pow(x,(2*i-2))*pow(-1,(i+1))/fact;
   }
   }
    printf (“sum =%f”,sum);
    getch ();
}

 

Add a comment

Comments (2)

  1. discount poloMarch 23, 2012 Reply
    I simply understand why short post a good deal, we do hope you might come up with far more about this.
  2. burberry tieMarch 30, 2012 Reply
    Thank you for composing educational content. Im impressed together with your power to write convincing materials. you have supplied me plenty of thought-provoking sights to think about.

Add a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.



Connect with Me

GPO 8973 NPC 541; Kathmandu Nepal
Phone: +977 9851236800

Calendar

August 2020
S M T W T F S
« Jun    
 1
2345678
9101112131415
16171819202122
23242526272829
3031