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.

PHOTO EMBED

Wed May 01 2024 06:28:25 GMT+0000 (Coordinated Universal Time)

Saved by @JC

#include <stdio.h>

float equal(float in) {
    float cm = in * 2.4; 
    return cm;
}

int main() {
    float in, cm;

    printf("Enter length in inches: ");
    scanf("%f", &in);

    cm = equal(in);

    printf("%.2f inches is equal to %.2f centimeters.\n", in, cm);

    return 0;
}
content_copyCOPY