Sunday 15 June 2014

C++ program to convert centimeters to inches and feet


Here is a C++ program to convert centimetres to inches and feet


 SOURCE CODE OUTPUT
#include<iostream>
using namespace std;
int main()
{
    float inch,cen;
    int feet;
    cout<<"Enter the value in centimeters ";
    cin>>cen;
    inch=cen/2.54;
    feet=inch/12;
    inch=inch-feet*12;
    cout<<cen<<" centimeter is equals to "<<feet<<" feet "<<inch<<" inch";
    return 0;
}


Any questions regarding to program please write in comments.

1 comment:

  1. Plz give me a algorithm of this solution

    ReplyDelete