ADVERTENCIA: LOS SIGUIENTES ALGORITMO SE ENTREGA "COMO SON" ("AS IS") SiN GARANTIA DE NINGUN TIPO. DEBE REALIZAR LAS VERIFICACIONES CORRESPONDIENTES ANTES DE EMPLEARLOS PARA CUALQUIER FIN. SOLO TIENEN UNA FINALIDAD EDUCATIVA.

jueves, 25 de octubre de 2012

Ejemplo de Algoritmo para determinar la hipotenusa de un triangulo (PseInt)


Proceso ComputaHipotenusa

Definir co como real;
Definir ca Como real;
Definir hipotenusa_cuadrada como real;
Definir hipotenusa como real;

Escribir "Ingrese longitud del cateto opuesto en cm: ";
Leer co;

Escribir "Ingrese longitud del cateto adyacente en cm: ";
Leer ca;

hipotenusa_cuadrada <- co*co + ca*ca;

hipotenusa <- raiz (hipotenusa_cuadrada);

Escribir "La hipotenusa del triangulo es: ",hipotenusa," cm";

FinProceso

No hay comentarios:

Publicar un comentario