Inch to Centimeter Convertion

PHOTO EMBED

Thu Apr 25 2024 08:53:13 GMT+0000 (Coordinated Universal Time)

Saved by @kervinandy123 #c

#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);
}
content_copyCOPY

Write a function that converts the input inches into its equivalent centimeters. One inch is equal to 2.4 cms. Display the converted centimeters value.