Convertidor De Longitudes Fortran

Páginas: 2 (278 palabras) Publicado: 21 de septiembre de 2011
program convertidor_de_longitudes
implicit none
!seccion de declaracion
real mag_o,mag_c
character(4)uni_o,uni_c
!seccion de ejecucion
print *,"dame la magnitud,unidad de origen y unidada convertir"
read *, mag_o,uni_o,uni_c
if(uni_o=="m")then
if(uni_c=="cm")then
mag_c=100*mag_o
else
if(uni_c=="ft")then
mag_c=3.28084*mag_oelse
if(uni_c=="pulg")then
mag_c=39.3701*mag_o
else
if(uni_c=="m")thenmag_c=mag_o
else
print *,"UNIDAD A CONVERTIR NO VALIDA"
stopend if
end if
end if
end if
else
if(uni_o=="cm")then
if(uni_c=="cm")then
mag_c=mag_o
elseif(uni_c=="ft")then
mag_c=3.28084/100*mag_o
else
if(uni_c=="pulg")thenmag_c=39.3701/100*mag_o
else
if(uni_c=="m")then
mag_c=1./100*mag_oelse
print *,"UNIDAD A CONVERTIR NO VALIDA"
stop
end ifend if
end if
end if
else
if(uni_o=="ft")then
if(uni_c=="cm")thenmag_c=100/3.28084*mag_o
else
if(uni_c=="ft")then
mag_c=mag_o
else...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Fortran
  • Fortran
  • Fortran
  • fortran
  • fortran
  • FORTRAN ¿Qué es?
  • convertidor
  • Convertidor

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS