Answer to Question #325631 in C++ for remo

Question #325631

Write a program that takes length as input in feet and inches and convert it into centimeters. Using the constant for declaration of conversion constants. To calculate the equivalent length in centimeters, you need to multiply the total inches by 2.54. Similarly, to find the total inches, you need to multiply the feet by 12 and add the inches. 


1
Expert's answer
2022-04-08T03:47:39-0400
#include <iostream>

using namespace std;

int main()
{
	int inches, feet;
	cout << "Please, enter inches and feets to take the length:";
	cout << "\nInches:";
	cin >> inches; 
	cout << "Feets:";
	cin>> feet;
	float centimetr=(feet*12+inches)*2.54;
	cout << "\nThe equivalent length in centimeters is "<< centimetr;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS