double height; double cm_per_inch=2.54; int feet=0; int inch=0; cout << "height (feet'inch):"; cin >> feet >> inch; height = (feet * 12 + inch) * cm_per_inch / 100; cout << "my height is" << height << "meter" << endl;
I juz started learning C++ programming. I am trying to convert feet and inches into meter. But this does not work. And i am not sure how to make it into a way which i can input the values like 5'4 and let the program understand that it means 5 feet and 4 inches.
So what's wrong with the codes and how can i make it understand 5'4 (or 3'5, 6'10, etc...) ??
Thank you
This post has been edited by alienglow: 15 September 2008 - 12:29 AM

New Topic/Question
Reply



MultiQuote




|