Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Lab_6
- {
- class Program
- {
- static void Main(string[] args)
- {
- double x = 0, e = 0.0001, E1 = 0, E2 = 1, S = -1, i = 0;
- x = Convert.ToDouble(Console.ReadLine());
- while (Math.Abs(E2 - E1) >= e)
- {
- i++;
- E1 = E2;
- E2 *= (- x * x) / (i * (i + 1));
- S += E2;
- }
- Console.WriteLine("S = " + S);
- Console.Read();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement