Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ConsoleApplication2
- {
- class Program
- {
- static long factorial(long n)
- {
- long toReturn = 1;
- for (int i = 2; i <= n; i++) {
- toReturn *= i;
- }
- return toReturn;
- }
- static void Main(string[] args)
- {
- double suma = 0.0;
- long x = 90;
- int k = 10;
- for (int i = 0; i <= k; i++)
- {
- suma += (Math.Pow(-1, k) * Math.Pow(x, 2 * k + 1)) / factorial(2 * k + 1);
- }
- Console.WriteLine(suma);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement