Question

Write a program to find Y=sin(x), where x=0,1,2,3,..., n and n is natural number and x in degree
0 0
Add a comment Improve this question Transcribed image text
Answer #1

C program to find sin series

Y= sin(x)

where, x is the angle in degree which is converted to Radian , converted as follows

x=x*3.14159/180

#include<stdio.h>
#include<conio.h>

void main()
{
    int i, n;
    float x, sum, t;
    clrscr();
     
    printf(" Enter the value for x : ");
    scanf("%f",&x);
     
    printf(" Enter the value for n : ");
    scanf("%d",&n);
     
    x=x*3.14159/180;
    t=x;
    sum=x;
     
    /* Loop to calculate the value of Sine */
    for(i=1;i<=n;i++)
    {
        t=(t*(-1)*x*x)/(2*i*(2*i+1));
        sum=sum+t;
    }
     
    printf(" The value of Sin(%f) = %.4f",x,sum);
    getch();
}

Add a comment
Know the answer?
Add Answer to:
Write a program to find Y=sin(x), where x=0,1,2,3,..., n and n is natural number and x...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT