Определить, проходит график функции y = x * 2 + 2 * x + 2 через точку А (x, y) - C#
Формулировка задачи:
Составить программу, определяющую, проходит график функции y = x * 2 + 2 * x + 2 через точку А (x, y). помогите плиз
Решение задачи: «Определить, проходит график функции y = x * 2 + 2 * x + 2 через точку А (x, y)»
textual
Листинг программы
class Program
{
static void Main(string[] args)
{
Console.WriteLine("y = x^2 + 2*x + 2");
Console.Write("Enter x: ");
int x = int.Parse(Console.ReadLine());
Console.Write("Enter y: ");
int y = int.Parse(Console.ReadLine());
if (y == x * x + 2 * x + 2)
Console.Write("A({0},{1}) belongs to the plot", x, y);
else
Console.Write("A({0},{1}) NOT belongs to the plot", x, y);
Console.ReadLine();
}
}