Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  long
Language: C/C++
Code:
#include <stdio.h>
#include <conio.h>
#include<math.h>
int main()
{float long1 ,long2; 
char metrique;
     printf("entrer la longueur que vous voulez convertir en metre");
scanf("%f",&long1);
printf("choisissez l'unite de sortie");
scanf("%s",metrique);
if('metrique'='km')
{long2=long1*pow(10,-3);}
elif('metrique'='hm'){long2=long1*pow(10,-2);}

elif('metrique'='dec'){long2=long1*pow(10,-1);}
elif('metrique'='m')
{long2=long1;}
elif('metrique'='dm')
{long2=long1*10;}
if('metrique'='cm'){long2=long1*pow(10,2);}

elif('metrique'='mm'){long2=long1*pow(10,3);
}
printf("votre longueur en %c est %f:",metrique,long2);
getch();
}
          
          
          
          
          
          
          
          
          
Comments: