Bob103

C#_for_Nigga_(V-4-№10)

Apr 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. class Program
  2.     {
  3.             private static double Rec(double i, double n)
  4.             {
  5.                 return i < n ? Math.Sqrt(i + Rec(++i, n)) : Math.Sqrt(i);
  6.             }
  7.  
  8.             static void Main(string[] args)
  9.             {
  10.                 Console.Write("Enter N:");
  11.                 var n = Convert.ToInt32(Console.ReadLine());
  12.                 Console.WriteLine("Result : " + n / Rec(1, n));
  13.                
  14.             }
  15.         }
Advertisement
Add Comment
Please, Sign In to add comment