P0 notes
As discussed in class, there is some syntax in P0 that you haven't been
taught. Most of you have been figuring it out, but I do appologize for the
problems. I wrote the assignement over break and didn't go back to check
that I was only using language constructs in that code which I had taught.
Plus there are a few other errors.
Syntax you don't know
- a%b returns the remainder of a/b
So 5%3=2
- i++ is the same as i=i+1;
- if(bob)
The statement is true unless bob==0.
- Main is declared oddly, Just ignore it.
- exit(1) causes the program to exit at that point.
It is like a return statement for the whole program.
Other issues: