4 ms·
Around 1995 or so I was learning C, and my cousin showed me algorithm (as in steps) to solve a simple 3x3 magic square (https://en.m.wikipedia.org/wiki/Magic_sq
by girishso 5y ago
Around 1995 or so I was learning C, and my cousin showed me algorithm (as in steps) to solve a simple 3x3 magic square (https://en.m.wikipedia.org/wiki/Magic_square https://en.m.wikipedia.org/wiki/Magic_square). Didn’t have ready access to computer back then, so I wrote the C program on a paper, debugged and ran it mentally and when I was satisfied, got to my fathers’ office that had a computer, luckily with the C compiler.
Typed down the program from paper and it compiled but simply won’t run, no output whatsoever. After hours of struggling, finally figured I had put semicolons after every single statement including all the ‘if’s and ‘for’s. Once I got rid of them, it worked flawlessly.
It was the first program I wrote by myself.