Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Test
- {
- public static void Main ()
- {
- double x, n = 1, s = 1, i = 1, c = 0.0001;
- do {
- Console.WriteLine ("Input x: ");
- } while(!double.TryParse (Console.ReadLine (), out x));
- while (n > c) {
- s += n;
- n = 1 / ((double)Math.Pow (x, 2 * i));
- Console.WriteLine ((1 / (double)Math.Pow (x, 2 * i)) + "\t" + "i = " + i + " ");
- Console.Write (s + "\n");
- i++;
- }
- //Console.WriteLine (s);
- Console.ReadLine ();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment