Thanks, Kmote and Baez.
Yeh i did pretty much indent it right but i just straight copy and pasted it so it lost it's formatting.
I'm using "C++ a beginners guide" by Herbert Schildt, and it's not said anything about this printf function. the first thing it taught was cout << and cin >>.
How does printf work ?
Also, not sure how to explain this as i can't remember exactley. But the book was teaching about the goto function, so i tried to use it to goto a part of code just before an if() statement (it may of also been a for() loop) but inside the block of code after the if() statement was a cin >>. However, it didn't let me input anything when i ran the program. It just stopped. No matter what i did using several methods and different code it continued to stop as soon as it reached a single cin >> statement, or just totally ignored it and moved on to the next line of code. I really can't remember what i was doing, all i know is that after using goto it wouldn't allow any console input when running the program.
Any reason why ?