Home / Programs / C program to convert centimeter to Inches
Programming Example

C program to convert centimeter to Inches

👁 1,585 Views
💻 Practical Program
📘 Step by Step Learning
C program to convert centimeter to Inches

Program Code

// 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; 
} 

Output

Inches is: 3.94

Explanation

Formula: double inch = 0.3937 * centi;

How to learn from this program

First read the algorithm, then study the program code line by line. After that, compare the code with the output and finally go through the explanation. This approach helps learners understand both the logic and the implementation properly.