Help on getting started with C++
Today we were set a task in labs to use Microsoft Visual Studio 2008 and use C++.
The question on the task was :
Test the following expressions, where a, b and c are all integers and a and b have been assigned the values 8 and 9, respectively. You need to explain in the report what the value of each of the following expressions is and if the value of a or b changes, you need to give their new value.
· c = b/a
· a = b
· a = b = 5
· c = ++a + b--
I'm a completely beginner so have ABSOLUTELY no idea where to start. Does anyone have any notes on the basic commands on C++, because I'm completely stuck. Please note I'm not looking for the answer, rather help so I may write the programme myself.
I think it should look something like the following please correct me if I'm wrong!
#include stdio.h
void main (void)
int a, b, c;
a = 8;
b = 9;
c = b/a;
printf (c=b/a);
Whilst on the topic, what does the printf command do, the scanf command?
Any and all help much appreciated!!