adds

Value of sinx by c ++

THEORY:
The formula used to express the sin(x) as sine Series is

CODING:
#include<iostream.h>
#include<conio.h>
#include<math.h>
int main()
{
int i,j,fact,sign=-1;
float x,p,sum=0,n=10;
clrscr();                                                  
cout<<"enter the value of x= \n";
cin>>x;
x=3.14*x/180;
for(i=1;i<=n;i+=2)
{
p=1;
fact=1;
for(j=1;j<=1;j++)
{
p=p*x;
fact=fact*j;
}
sign=-1*sign;
sum+=sign*p/fact;
}
cout<<"the value of sinx="<<sum;
getch();
}
 OUTPUT:


Model syllabus (+3)Downoad

List of all practicals:   Download

Get all Books:  Download
Physics Notes: CLICK

IIT-JAM             JEST                GATE               NET
                                                           
  • How to Prepare for IIT-JAM  ⇠ ⇠ Click Here
Get everything about your B.Sc (+3) Physics Practical⇠ ⇠Click


Post a Comment

Previous Post Next Post