#include <stdio.h> int main() { float inches, centimeters; /*Input length in inches from the user*/ printf( "Enter length in inches: " ); scanf( "%f" , &inches); /*Convert inches to centimeters*/ centimeters = inches * 2.54; /* Display the result */ printf( "%.2f inches is equal to %.3f centimeters\n" , inches, centimeters); return 0; }
Comments
Post a Comment