convert centimeter into meter and kilometer

#include<stdio.h>
int main() {
    float cm,m,km;
    scanf("%f",&cm);
    m=cm/100.0;
    km=cm/1000.0;
    printf("Meter is %f\n ",m);
    printf("Kilo Meter is %f\n ",km);
   
    return 0;
}
Input:
233.5

Output:
Meter is 2.335000
 Kilo Meter is 0.233500

No comments:

Post a Comment