"The best way to cheer yourself up is to try to cheer somebody else up." Mark Twain

Monday, April 26, 2010

WAP to input your height in feet and inches. Convert it into centimeter.


#include<iostream.h>
#include<conio.h>

void main()
{
clrscr();
int in, feet, cm;
cout<< "\n Enter your height in feet and inches respectively :";
cout<<"\nYour height is " << feet <<"ft" << in << "inches";
cin >> feet >> in;
in = in + feet * 12;
 cm = in * 2.54;
cout << "\n Your height in  cm. is " <<  cm;
getch();
}

No comments:

Post a Comment

C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off.
Now Playing: Ballade Pour Adeline

About Me

My photo
I m an IT lecturer of a college. I love social-work. I want to do something beneficial for society before dying , that can promote our society, to some extent.