Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static double h;
- static double rec(int n, double x)
- {
- h = 5;
- double y = x;
- while (n > 0)
- {
- y = x / (n + y);
- n--;
- rec(n, x);
- }
- return y;
- }
- static void Main(string[] args)
- {
- Console.WriteLine("Enter n: ");
- int n = int.Parse(Console.ReadLine());
- Console.WriteLine("Enter x: ");
- double x = double.Parse(Console.ReadLine());
- double t = x;
- double y = rec(n, x, t);
- Console.WriteLine("Result: {0}", rec(n, x, t));
- Console.WriteLine("Result: ");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement