Doylexx,
Below is an explantion of each point you list in your question.
[[ What is int i, j; ]]
Declares two variables named i and j, both of type int (Integer).
[[ What is char c: ]]
Declares a variable named c of type char, which holds a single character.
[[ What is float x ]]
Declares a variable named x of type float (floating point number).
[[ i=4 ]]
Assigns the value 4 to the variable named i.
[[ j=i+7; ]]
Assigns the current value of the variable named i plus 7 to the
variable called j. For example, if the current value of i is 4, then j
would equal 11 after this line runs.
[[ x=9.087 ]]
Assigns the value 9.087 to the variable named x.
[[ x=x*12.3 ]]
Multiplies the current value of the variable named x by 12.3 and
assigns the result back to the variable called x.
[[ std::cin>> integer1; ]]
Uses the stream extraction operator (>>) to place the value typed by
the user in a variable named integer1. std::cin means standard input.
[[ cout<<i << "," << j << ", " << x << "\n"; ]]
Uses the stream insertion operator (<<) to send the expression(s) on
the right to standard output (cout). The result sent to standard
output would be the value of i followed by a comma and a space,
followed by the value of j followed by a comma and a space followed by
the value of x followed by a newline (\n). So if the variables are set
as follows:
i = 5
j = 10
x = 9.087
...then the output would be
5, 10, 9.087 (newline)
Please ask for clarification if you need additional information on these concepts.
- Hammer
Additional Info
----------------
An explanation of variable types like int, char and float, variable
declarations and assignments.
http://www.cplusplus.com/doc/tutorial/variables.html
An introduction to stream operators
http://www.cplusplus.com/doc/tutorial/basic_io.html |