/*Write a C program that
accepts a distance in
centimeters and
prints the corresponding
value in inches.
Test Data:
Input Data: 500cms
Input the distance in cm:
Distance of 500.00 cms is =
196.85 inches
*/
#include <stdio.h>
#define cms 2.54
int main()
{
float cm,result;
printf("Input the distance\
in cm: ");
scanf("%f",&cm);
result=(cm/cms);
printf("Distance of %.2f \
\ncms is = %.2f inches",cm,
result);
return 0;
}
No comments:
Post a Comment