conversion program code errors help please

Im very new to programming and i have to write a code to convert centimeters to yards feet and inches i have the code wrtten up and keep getting 2 errors saying im missing a ; before << but im not sure why help please

#include <iostream> //For cin and cout
using namespace std;

int main(void)
{
double centimeters; //INPUT

cout << "Enter Centimeters Here: " << endl;
cin >> centimeters;

double conv2inch, //CALCULATIONS
inches,
feet,
Rinch,
yards,
Rfeet;

conv2inch = centimeters / 2.54;
inches = conv2inch;
feet = floor(inches / 12);
Rinch = inches - (feet * 12);
yards = floor(feet / 3);
Rfeet = feet - (yards * 3);


cout << "\n\nCentimeter: " << centimeters << endl //OUTPUT
<< "\n\nAnswers: "
<< "\nYards= " << yards;
error----> << "Feet= " << Rfeet;
error----> << "Inches= " << Rinch << "\n" << endl;

//The next two lines stop the Command Prompt window from closing
//until the user presses a key, including Enter.
cout << "Press any key to exit." << endl;

return 0;
}
Last edited on
cout << "\n\nCentimeter: " << centimeters << endl //OUTPUT
<< "\n\nAnswers: "
<< "\nYards= " << yards;
error----> << "Feet= " << Rfeet;
error----> << "Inches= " << Rinch << "\n" << endl;

You placed a semicolon after variable yards. So this statement was ended. And as the result the next statement starts as

<< "Feet= " << Rfeet;

Either you can place cout in the beginning of this line

cout << "Feet= " << Rfeet;

Or you should remove the previous semicolon. The same is valid for the second statement with the error.
Oh cool ty very much it was driving me crazy
Topic archived. No new replies allowed.