Saturday, June 21, 2014

C#: Enter value x from keyboard. Calculate the value of y by the formula

Enter value x (float) from keyboard. Calculate the value of y by the formula:

Source code:
namespace Example1
{
    class Program
    {
        static void Main()
        {
            double x, y;
            Console.WriteLine("Input x: ");
            x = int.Parse(Console.ReadLine());
            y=(x*x*x + Math.Sqrt(x))/(x*x + 1 + Math.Sin(x));
            Console.WriteLine(y);
            Console.ReadLine();
        }
    }
}

No comments:

Post a Comment