0% found this document useful (0 votes)
416 views

Algorithm Fact Sine Summation

This document provides an algorithm to compute the sine series for an angle x in degrees up to n terms: 1. Initialize variables to compute each term of the series like power, denominator, numerator starting with x converted to radians. 2. Take the number of terms n from the user and initialize the sum to the first term. 3. Iterate from the third term to the nth term, computing each new power, denominator, numerator, and alternating sign and adding to the running sum.

Uploaded by

creatorvision
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
416 views

Algorithm Fact Sine Summation

This document provides an algorithm to compute the sine series for an angle x in degrees up to n terms: 1. Initialize variables to compute each term of the series like power, denominator, numerator starting with x converted to radians. 2. Take the number of terms n from the user and initialize the sum to the first term. 3. Iterate from the third term to the nth term, computing each new power, denominator, numerator, and alternating sign and adding to the running sum.

Uploaded by

creatorvision
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

Algorithm for finding factorial of any number 1. Take a number as input from the user. 2.

Initialize a variable fact=1 3. fact=fact*number 4. number=number-1 5. Repeat steps 3 to 5 till number>0. 6. Print the value of fact variable.

Algorithm for Sine Series computation

sin(x) = x - x3/3! + x5/5! x7/7!......xn/n!


1. Initialize variables i = 2, n, s = 1, x, pwr = 1, dr=1, nr = 1, x1, sum. 2. Take the value of the angle x for which the series has to be developed. 3. Make x1 as 3.142 * (x / 180.0) and sum = x1. 4. Take the number of terms from the user in n. 5. 6. 7. 8. 9. 10. pwr = pwr + 2; dr = dr * pwr * (pwr - 1); nr = nr * x1 * x1; s = s * (-1); sum = sum + (nr / dr) * s; i= i + 2;

11. Repeat steps 5 to 10 until i<=n. 12. Print the sum of the series.

You might also like