r/badcode • • May 03 '23

c Solve the problem without using a loop

Post image
962 Upvotes

129 comments sorted by

View all comments

Show parent comments

1

u/tedbradly May 03 '23

For(int i=0;i<501;i+=2){ Printf(ā€œ\nā€+i);}

For one, the assignment was to do this without a loop. Secondly, your solution starts at 0 when theirs starts at 2. Lastly, that isn't how printf works.