jituTechnology

jituTechnology

The Sin of X can be calculated approximately by using the first n terms of the infinite series

The Sin of X can be calculated approximately by using the first n terms of the infinite series( X is expressed in radians,
/*program to find sine of x can be calculated approximately by using the firstn terms of the infinite 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-1;j++)
   {
     fact *=i;
      sum += pow(x,(2*i-1))*pow(-1,(i+1))/fact;
   }
   }
    printf (“sum =%f”,sum);
    getch ();

}

Add a comment

Comments (1)

  1. Oneida TurturaApril 5, 2012 Reply
    Hmm is anyone else having problems with the pictures on this blog loading? I’m trying to determine if its a problem on my end or if it’s the blog. Any suggestions would be greatly appreciated.

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

April 2024
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
282930