The indent is wrong due to copy/pasting and I have not removed the scaffolding.

I'm pretty sure I made some mistakes with the declaration in the beginning as well as the difficulty to use exponential with variables (red), altohugh I'm not sure how to solve it. Any help is greatly appreciated.

Sorry, but that is bad advice. Sure, you can't add spaces just anywhere you want, but things should be spaced out to make it more readable. Squishing everything together like you did is not good.

Although the unportable system("pause") does hint he's using Windows, I suggest not even using that. Why write unportable programs when it's no harder to write it portably (in this case)? No need to clear the screen, and something like cin.get() at the end should work as well as the pause. Adding Windows conio stuff makes it more unportable and more non-standard.

Matara, this line still isn't quite right:

cout >> "x1 =" << endl << endl << x1;

It should be:

cout << "x1 =" << endl << endl << x1;

All the operators should be <<, not >>. They go the other way for input. For example:

Code (Text):

char c;
cin >> c;

That's formatting it like you seemed to want to, but I'm not sure why you want two newlines between "x1 = " and the variable value. Right now, if x1 is 42, you'll end up printing:

x1 =

42

Most people would stick to:

cout << "x1 = " << x1 << endl;

But that's up to you.

As Pratibha_S pointed out, this is wrong:

cin >> a, b, c;

And should be:

cin >> a >> b >> c;

When you enter them, they should be separated by spaces. Might not be a bad idea to point that out in a prompt.

And I guess you know about the missing "int " in front of your main function.

Lastly, when you post code, to preserve the rather important indentation, put your code between CODE tags. Put [ CODE] in front and [ /CODE] at the end, removing the spaces I put in after the opening square brackets.

Aside from the errors already noted, the python version is superior, from the perspective of a naive user of your program, because each variable has its own prompt. The prompt in the C++ version, "ax^2 + bx + c = 0" might be decipherable for you, the author of the program, but it doesn't offer much information for someone who isn't as familiar with your program.

2. You are calculating the roots of the quadratic in a nonintuitive way.