Preview:
#include <stdio.h>
float convert(float x);


int main() {
    float inch, centimeter;
    printf("--Inch to Centimeter Convertion--\n");
    printf("Enter a number: ");
    scanf("%f", &inch);
    
    centimeter=convert(inch);
    printf("%.2f\' is equivalent to %.2f cm", inch, centimeter);
    
    return 0;
}

float convert(float x)
{
    return(x*2.54);
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter