Q:

Write a C program to convert feet to inches

0

Write a C program to convert feet to inches. Here’s simple program to convert feet to inches in C Programming Language.

In this program, we take input from the user to enter an integer value of feet which he/she wants to convert it into inches. As we know that “1 feet = 12 inches”, so we use the basic formula for the conversion of feet into inches i.e (inches = feet * 12) to get result in inches.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Below is the source code for C program to convert feet to inches which is successfully compiled and run on Windows System to produce desired output as shown below :

SOURCE CODE : :

/*  C program to convert feet to inches  */

#include<stdio.h>

int main()
{
                int feet,inches;
                
                printf("Enter the value of feet: ");
                scanf("%d",&feet);
                
                //converting into inches
                inches=feet*12;
                
                printf("\nTotal inches will be: %d\n",inches);
                return 0;
}

 

OUTPUT : :

/*  C program for conversion of feet to inches  */

Output ::

Enter the value of feet: 10

Total inches will be: 120

Above is the source code for C program for conversion of feet to inches which is successfully compiled and run on Windows System.The Output of the program is shown above .

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C Basic Solved Programs – C Programming

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a C program to print ASCII value of entered ... >>
<< Write a C program to demonstrate example of global...