I can't for the life of me figure out how I'm supposed to use float.
Here's the simple peice of code:
Pretty simple, but I get a crazy number when I input centimeters (something like -1678682734). Any thoughts would be really appreciated, thanks.Code:#include <stdio.h> int main() { int centimeters; float inches; printf("Enter the number of centimeters you would like converted to feet\n" ); scanf("%d" , ¢imeters ); inches = centimeters / (float) 2.54; printf("The total inches is %d\n", inches ); return 0; }
P.S. yes I'm a newbie programmer, but hey you gotta start somewhere