elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Arreglado, de nuevo, el registro del warzone (wargame) de EHN


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  Ejercicios
| | | |-+  PROGRAMACION EN C# METODO DE RUFFINI Y HORNER MODO DOS
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: PROGRAMACION EN C# METODO DE RUFFINI Y HORNER MODO DOS  (Leído 12,625 veces)
LUCHITO1418

Desconectado Desconectado

Mensajes: 1


Ver Perfil
PROGRAMACION EN C# METODO DE RUFFINI Y HORNER MODO DOS
« en: 13 Diciembre 2010, 06:51 am »

MODELO MATEMÁTICO DE RUFFINI
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            //MODELO MATEMÁTICO DE RUFFINI
            //NOMBRE:  LUIS
            int  i;
            int  grado;
           
            float x;
            float[] residuo;
            float[] coeficiente;
            Console.WriteLine("ALGORITMO DE DIVISIÓN SINTÉTICA");
            Console.WriteLine();

            Console.WriteLine("INGRESE EL GRADO DE LA ECUACIÓN");
            grado =int.Parse(Console.ReadLine());
            coeficiente = new float[grado+1 ];
            residuo = new float[grado+1];
            for (i = 0; i <= grado; i++)
            {
                Console.WriteLine("INGRESE EL COEFICIENTE->{0}  ",i );
                coeficiente  = float.Parse(Console.ReadLine());
            }
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("INGRESE EL VALOR DE X-> ");
            x = float.Parse(Console.ReadLine());
            residuo[0] = coeficiente[0];

            Console.WriteLine();
            Console.WriteLine();
           
            //Procesando datos
            for (i = 1; i <= grado ;i++ )
            {
                residuo = (residuo[i - 1] * x) + coeficiente;
            }
           
            Console.WriteLine("ESCRIBIR RESIDUO  {0}", residuo [grado ]);
            Console.ReadLine();

        }
    }
}







MODELO MATEMÁTICO DE HORNER

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            //MODELO MATEMÁTICO DE HORNER
            //NOMBRE:
            int  i;
            int  grado;
           
            float x;
            float h;
            float[] coeficiente;
            Console.WriteLine("MODELO MATEMÁTICO DE HORNER");
            Console.WriteLine();
            Console.WriteLine("ALGORITMO DE HORNER");
            Console.WriteLine();
            Console.WriteLine("INGRESE EL GRADO DE LA ECUACIÓN");
            grado =int.Parse(Console.ReadLine());
            coeficiente = new float[grado+1 ];
            Console.WriteLine();
            for (i = 0; i <= grado; i++)
            {
                Console.WriteLine("INGRESE EL COEFICIENTE-> {0}  ",i );
                coeficiente  = float.Parse(Console.ReadLine());
            }
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("INGRESE EL VALOR DE X-> ");
            x = float.Parse(Console.ReadLine());
            h  = coeficiente[0];

            Console.WriteLine();
            Console.WriteLine();
           
            //Procesando datos
            for (i = 1; i <= grado ;i++ )
            {
                h = (h* x) + coeficiente;
                Console.WriteLine("ESCRIBIR RESIDUO  {0}", h);
                Console.ReadLine();
            }
            Console.WriteLine();
            Console.WriteLine("RESULTADO ES->  {0}", h);
            Console.ReadLine();
           
        }
    }
}


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Python] invocar metodo desde metodo.
Scripting
Hesp 2 6,992 Último mensaje 8 Marzo 2009, 00:38 am
por Hesp
ayuda raíz de ecuación cuadrática mediante ruffini en C
Programación General
nightcode 2 3,867 Último mensaje 31 Diciembre 2013, 14:52 pm
por nightcode
¿Qué les parece Ruby como método de programación?
Foro Libre
WIитX 0 1,339 Último mensaje 10 Abril 2014, 09:41 am
por WIитX
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines