// C program to convert centimeter to Inches
#include <stdio.h>
// Function to perform conversion
double Conversion(int centi) {
double inch = 0.3937 * centi;
printf ("Inches is: %.2f \n", inch);
return 0;
}
// Driver Code
int main() {
int centi = 10;
Conversion(centi);
return 0;
}
Inches is: 3.94
Formula: double inch = 0.3937 * centi; First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.
Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.