It's a simple program but what am I doing wrong here?
#include <iostream>
using namespace std;
int main()
{
double pounds, kilograms;
cout<<"please enter your weight"<<'\n';
// this is where the problem is (the cin line)
cin>> pounds >>'\n';
kilograms =pounds/2.2;
cout<<"your weight in kilos is:"<<'\n';
cout<<kilograms<<"kilos"<<'\n';
return 0;
}
here is the second and I'm having the same problem with my cin statement
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double volume, radius, height;
cout<<"how tall is the tank?"<<;
cin<<height;
cout"what is the radius?"<<;
cin<<radius;
volume =3.14159*pow(radius,2.0)*height;
cout<<"the volume of the cylinder is:"<<volume<<'\n';
return 0;
cout<<"how tall is the tank?"<<; // add something after << or remove it
cin<<height; // "<<" should be ">>"
cout/*missing << */"what is the radius?"<<; // same errors from here to the next lines...