Составить алгоритм расчёта функции - C#
Решение задачи: «Составить алгоритм расчёта функции»
textual
Листинг программы
using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.Write("Введите x: ");
double x = double.Parse(Console.ReadLine());
Console.WriteLine("y = {0}", function(x));
Console.ReadKey();
}
static public double function(double x)
{
double y = Math.Sqrt(Math.Pow(x, 2) - 4) + (2 * Math.Pow(x, 2));
return y;
}
}
}