Prompt user to input distance in Kilometers and display it in meters.
#include <stdio.h>
int main() {
// Prompt user to input distance in Kilometers
// and display it in meters.
printf("Enter distance in Kilometers: ");
int distance;
scanf("%d", &distance);
printf("%dkm = %dm\n", distance, distance * 1000);
return 0;
}
Comments
Leave a comment