Yes, I think I understand it now. Thanks Mozza. You have been very helpful through out without any air of arrogance!
Originally Posted by Mozza314
Okay, when I use double quotation marks I have text
When I simply enter something, such as A, B, C, etc, it is expected to be a variable.
When I use single quotes then it's a character constant - a constant of special type which has a particular symbol and recognized by the system. But what if I try to use some self-invented character symbol (I see '+' is also taken as a character) which has been standardized by ASCII, then would it give error?
Is this correct? Please correct me if I'm wrong.
Now some more questions. My questions will appear in the code following "//". It would be nice of you if you could shed some light. (sorry, if there is a big issue with indentation, when I copy the code here something goes wrong)
# include <cmath>
#include <cstdlib> // these are header files?
using namespace std; // this is "using" statement?
int main () // this is the function which we are using?
float a, b, c, R1, R2; // this is the declaration statement?
system("Color 1A"); // this is what? I use it to change the color of the console.
cout << "Enter a, b, c of the equation ax^2 + bx + c = 0" << endl;
cout << "Enter a = ";
cin >> a; // what are cout and cin statements called?
cout << "Enter b = ";
cin >> b;
cout << "Enter c = ";
cin >> c;
float D = b*b - 4*a*c; // this both declaration and processing statement?
if (D >= 0)
cout << "R1 is = " << ( -b + sqrt(D) )/( 2*a ) << endl;
cout << "R2 is = " << ( -b - sqrt(D) )/( 2*a ) << endl;
} // this is if statement?
cout << "no real roots exist" << endl;
system("PAUSE"); // what would called this? "system" specific statement?