for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
if (j = i) table [j] = 1;
else table [j] = 0;

Compiler says no. Single "=" is assignment, which doesn't return a boolean.

No output in any case, since you're only assigning to memory, not writing to the screen.


Fun puzzle in C, though. Should create an array like so:

0 0 0 
1 1 1
1 1 1

if I'm reading it right (assuming you've declared table as an array[3][3] and all that fun stuff)

If I am not mistaken the output will be exactly what you will see on the screen once you will try to compile and run it yourself :)

what an odd question.. obviously you're not printing anything to the screen so you shouldnt observe any output..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.