Im making a program which converts meters into decimeters and then centimeters, and want to show it as for example 3m=30dm=300cm like that but i have no idea why my code is not working
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <stdio.h>
#include <conio.h>
void main()
{
int x,cm,dm;
printf("Input number in meters!" );
scanf("%d",&x);
dm=x/10;
x=x%10;
cm=x/100;
x=x%100;
printf("%d=%d=%d=",x,dm,cm);
getch();
}
#include <stdio.h>
#include <conio.h>
int main()
{
int x,cm,dm;
printf("Input number in meters!" );
scanf("%d",&x);
dm=x*10;
cm=x*100;
printf("%d=%d=%d=",x,dm,cm);
getch();
}