Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

namespace ALGORITMO_HORNER

{
class Program
{
static void Main(string[] args)
{
int n, j, sum = 0;

int[] V = new int[30];


Console.WriteLine("Ingrese un Limite");
n = Convert.ToInt32(Console.ReadLine());
n++;

for (int i = 0; i < n; i++)


{
Console.WriteLine(" Ingrese la posicion " + (i) + " del
Polinomio ");
V[i] = Convert.ToInt32(Console.ReadLine());
}
Console.WriteLine("Ingrese el Valor de X:");
int X = Convert.ToInt32(Console.ReadLine());
j = n;
while (j >= 0)
{
sum = V[j] + X * sum;
j--;
}
Console.WriteLine("El Resultado es:" + sum);
Console.ReadLine();
}
}
}

eveintim@hotmail.com

You might also like