Wednesday, 10 September 2014

Unit Conversion in C++

18:35

Program Code:

#include <iostream>
#include <conio.h>
#include <math.h>
using namespace std;
int main()
{float x,y;
cout<<"Enter a number in cm: ";
cin>>x;
y=x*0.39370;
cout<<"The Number in inches is "<<y<<endl;
y=x * 0.032808;
cout<<"The Number in Foot is "<<y<<endl;
y=x/100;
cout<<"The Number in meters is "<<y<<endl;
y=x * 0.010936;
cout<<"The Number in Yards is "<<y<<endl;
y=x/100000;
cout<<"The Number in Km is "<<y<<endl;
y=x/160000;
cout<<"The Number in Mile is "<<y<<endl;
getche ();
return 0;

}

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 comments:

Post a Comment

 

© 2013 All in One. All rights resevered. Designed by Templateism

Back To Top