viernes, 16 de noviembre de 2018

CONVERSOR DE PESO

 CONVERSOR DE PESO

#include <conio.h>
#include <stdio.h>
#include <math.h>

int main ()
{
                int lib, gra, ton,kil,mil,met, seg, dia, op;
                float con;
               
                printf("\n CONVERSOR");
                printf("\n 1- GRAMOS A LIBRAS");
                printf("\n 2- LIBRAS A GRAMOS");
                printf("\n 3- MILIMETROS A METROS ");
                printf("\n 4- METROS A MILIMETROS");
                printf("\n 5- LIBRAS A TONELADAS");
                printf("\n 6- TONELADAS A LIBRAS");
                printf("\n 7- SEGUNDOS A DIAS");
                printf("\n 8- DIAS A SEGUNDOS");
                printf("\n Ingrese su opcion:");
                scanf("%d", & op);
               
                if (op==1)
                {
                               printf ("\n GRAMOS A LIBRAS");
                               printf ("\n Ingrese gramos:");
                               scanf ("%d", &gra);
                               con= 0.0022*gra;
                              
                               printf ("LA CONVERSION A LIBRAS ES:%2.f", con);
                }
               
                if (op==2)
                {
                               printf ("\n LIBRAS A GRAMOS");
                               printf ("\n Ingrese LIBRAS:");
                               scanf ("%d", &mil);
                               con= lib*453.592;
                              
                               printf ("LA CONVERSION A GRAMOS ES:%2.f", con);
                }
               
                if (op==3)
                {
                               printf ("\n MILIMETROS A METROS");
                               printf ("\n Ingrese MILIMETROS:");
                               scanf ("%d", &mil);
                               con= mil*0.001;
                              
                               printf ("LA CONVERSION A METROS ES:%2.f", con);
                }
               
                if (op==4)
                {
                               printf ("\n METROS A MILIMETROS");
                               printf ("\n Ingrese METROS:");
                               scanf ("%d", &met);
                               con= met*1000;
                              
                               printf ("LA CONVERSION A MILIMETROS ES:%2.f", con);
                }
               
                if (op==5)
                {
                               printf ("\n LIBRAS A TONELADAS");
                               printf ("\n Ingrese LIBRAS:");
                               scanf ("%d", &lib);
                               con= lib*0.000454;
                              
                               printf ("LA CONVERSION A TONELADAS ES:%2.f", con);
                }
               
                if (op==6)
                {
                               printf ("\n TONELADAS A LIBRAS");
                               printf ("\n Ingrese TONELADAS:");
                               scanf ("%d", &ton);
                               con= ton*2204.623;
                              
                               printf ("LA CONVERSION A LIBRAS ES:%2.f", con);
                }
               
                if (op==7)
                {
                               printf ("\n SEGUNDOS A DIAS");
                               printf ("\n Ingrese SEGUNDAS:");
                               scanf ("%d", &seg);
                               con= seg* 1.157*pow(10,-5);
                              
                               printf ("LA CONVERSION A DIAS ES:%2.f", con);
                }
               
                if (op==8)
                {
                               printf ("\n DIAS A SEGUNDOS");
                               printf ("\n Ingrese SEGUNDOS:");
                               scanf ("%d", &dia);
                               con= dia*86400;
                              
                               printf ("LA CONVERSION A SEGUNDOS ES:%2.f", con);
                }
                return 0;
}             

No hay comentarios.:

Publicar un comentario