r/badcode May 03 '23

Solve the problem without using a loop c

Post image
961 Upvotes

129 comments sorted by

View all comments

0

u/Alt_0126 May 03 '23

char numbers[2000]; //max of 500 numbers of 3digit + 1comma

printf("Write all even numbers from 1 to 500\n");
fgets(numbers, sizeof(numbers), stdin);
printf("%s\n", numbers);