error C2143

May 25, 2013 at 7:46pm
i've wrote a simple program:

#include <iostream.h>
int main()
{
float a;
cout<<"a=";
cin>>a "\n";
return 0;
}

But when I press ctrl+f5 to run it, visual c++ 6 gives me an error:
error C2143: syntax error : missing ';' before 'string'
What does it mean?
May 25, 2013 at 7:48pm
cin>>a "\n"; Makes no sense
change it to cin>>a;
May 25, 2013 at 7:49pm
for cin>>a "\n"; you don't need the "\n" in it.
cin >> a;

What are you trying to do with the program?
Last edited on May 25, 2013 at 7:50pm
Topic archived. No new replies allowed.