Question: One yard equals 3 6 inches. The following program intends to read a floating - point value from input, convert the value from inches to

One yard equals 36 inches. The following program intends to read a floating-point value from input, convert the value from inches to yards, and output the length in yards, but the code contains errors. Find and fix the errors.
Ex: If the input is 3.1, then the output is:
0.086 yards
using namespace std;
int main(){
// Modify the following code
int lengthInches;
int lengthYards;
cin lengthInches;
lengthYards = lengthInches ?36;
cout fixed setprecision(3) lengthYards " yards" endl;
return ;
}
 One yard equals 36 inches. The following program intends to read

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!