Professional Documents
Culture Documents
#include <stdio.h>
int main() {
// Write C code here
int a,b;
printf("----------------------\n");
printf(" CONVERSION \n");
printf("------------------------\n");
printf("\n");
printf("km to meter-->enter 1\n");
printf("inch to foot-->enter 2\n");
printf("cm to inch-->enter 3\n");
printf("inch to meter-->enter 4\n");
printf("pound to kgs-->enter 5\n");
printf("enter any number:");
scanf("%d",&a);
if(a==1)
{
printf("enter the number that you convert km to meter:");
scanf("%d",&b);
printf("km to meter is :%d",b*1000);
}
else if(a==2)
{
printf("enter the number that you convert inch to foot: ");
scanf("%d",&b);
printf("inch to foot is :%0.4f",(float)b*0.08333);
}
else if(a==3)
{
printf("enter the number that you convert cm to inchs :");
scanf("%d",&b);
printf("cm to inch : %0.4f",(float)b*0.393701);
}
else if(a==4)
{
printf("enter the number that you convert inches to meter :");
scanf("%d",&b);
printf("inch to meter: %0.4f",(float)b*0.0254);
}
else if(a==5)
{
printf("enter the number that you convert pound to kgs :");
scanf("%d",&b);
printf("pound to kgs :%0.4f",(float)b*0.453592);
}
else{
printf("!! enter number is incorrect !!");
}
return 0;
}