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;
}
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;
}
Plz give me a algorithm of this solution
ReplyDelete