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

C program to convert centimeter to Inches

👁 1,585 Views
💻 Practical Program
📘 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; 
} 
                        

🖥 Program Output

Inches is: 3.94
                            

📘 Explanation

Formula: double inch = 0.3937 * centi;
📚 Learning Subject

Master Programming Through Practical Examples

Improve your coding logic, problem-solving skills and programming confidence by practicing real-world examples with explanations.

🎯 How to learn from this example

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.

🔥 Practice suggestion

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.