For a complete noob, he/she has no idea how the grammar is, nor program runs. eg. "What does main(), #include means?".
While observing how my brother learn (well, I kinda force him to), this is the code he wrote (after first few chapter of the infamous "21days"):
#include <iostream>using namespace std; // i modified it a little here ;) void main(void) { int x = 5; int y = 7; int useranswer; cout << "Pls enter number:"; cin >> useranswer; if (useranswer == 12) { cout << "correct." << endl else cout << "wrong." << endl; cout << "The answer is useranswer" << endl } return 0; // after some trial and error // he change to: return;}
Notice anything wrong?? Why he did it this way?
[edited by - DerekSaw on January 26, 2003 10:49:33 PM]