C Function that converts inches to centimetre.

//C Function that converts inches to centimetre.


#include <stdio.h>

float convert(float a);

int main()
{
	float inch,cm;
	printf("Enter value in Inch : ");
	scanf("%f",&inch);
	cm=convert(inch);
	printf("%.2lf inch is equal to %.2lf centimeter ",inch,cm);
	return 0;
}

float convert(float a)
{
	float cm1;
	cm1=a*2.54;
	return cm1;
}

Output :
Enter value in Inch : 50

50.00 inch is equal to 127.00 centimeter



Leave a comment