#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; }
Preview:
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