C LANGUAGE - TO CONVERT KILO METER TO METER,CENTIMETER OR MILLI METER

// K.M. to meter, centimeter or mm #include<stdio.h> int main() { float km; int v; float ans; printf("Enter distance in K.M. : "); scanf("%f",&km); printf("1 for meter 2 for centimeter 3 for mm : "); fflush(stdin); scanf("%d",&v); if(v==1) { ans=km*1000; } if(v==2) { ans=km*100000; } if(v==3) { ans=km*1000000; } printf("Answer : %.2f",ans); return 0; }
Note: Click on copy button to copy the given code and you can paste it in any online compiler to see the result, IF YOU ARE A MOBILE USER THEN DOWNLOAD "CODING C"(Free App) COMPILER FROM GOOGLE PLAY STORE.