SHARE
TWEET

Untitled

a guest Apr 19th, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. double p = 1;
  2.                 double x = Convert.ToDouble(Console.ReadLine());
  3.                 int k= Convert.ToInt32(Console.ReadLine());
  4.                 for (double n = 0; n < k; n++)
  5.                 {
  6.                     p *= (1 + ((Math.Pow(-1, n) * Math.Pow(x, 2 * n)) / ((n + 2) * (n + 1))));
  7.                     Console.WriteLine(p);
  8.                 }
  9. double n=0;
  10. p=1;
  11. while(n<k)
  12. {
  13.  p *= (1 + ((Math.Pow(-1, n) * Math.Pow(x, 2 * n)) / ((n + 2) * (n + 1))));
  14.                     Console.WriteLine(p);
  15. n++;
  16. }
  17. n=0;
  18. p=1;
  19. do
  20. {
  21.  p *= (1 + ((Math.Pow(-1, n) * Math.Pow(x, 2 * n)) / ((n + 2) * (n + 1))));
  22.                     Console.WriteLine(p);
  23. n++;
  24. }
  25. while(n<k)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top