Print the square roots of the first 25 odd positive integers. IN C#

 

Print the square roots of the first 25


CODE:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

 

namespace For_Loop_lab6

{    class Program

    {       static void Main(string[] args)

        {       DateTime dt = DateTime.Now;

            Console.WriteLine("{0}",dt);

           int n = 25;

            double result,odd;

            for (int i = 1; i <=25; i++)

            {

                odd = 2*i-1;

                result = Math.Sqrt(odd);

                Console.WriteLine("Square Root of {0} is {1}",odd,result);

            }

 

        }

    }

}

Comments

Popular posts from this blog

Vertical and Reverse Paramid in c# using loop.

Calculator in c# using Static Methods

Calculator in c# using Method void method