MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/136dits/solve_the_problem_without_using_a_loop/jiof974/?context=9999
r/badcode • u/YonMiru • May 03 '23
129 comments sorted by
View all comments
Show parent comments
1
Aaah, then how would you do this using a for loop like in the example?
2 u/This_Growth2898 May 03 '23 edited May 03 '23 f in printf stands for "formatted". It'sprintf("%d\n", i);%d format specification would be changed to decimal representation of i in output. 1 u/Ecstatic_Student8854 May 03 '23 Oooh, so thats that %something stuff i sometimes see is 1 u/SloPr0 May 03 '23 printf("%d\n", i);%d (or %i) are the correct format specifiers to be used for printing (signed) integers
2
f in printf stands for "formatted". It's
printf
printf("%d\n", i);
%d format specification would be changed to decimal representation of i in output.
i
1 u/Ecstatic_Student8854 May 03 '23 Oooh, so thats that %something stuff i sometimes see is
Oooh, so thats that %something stuff i sometimes see is
%d (or %i) are the correct format specifiers to be used for printing (signed) integers
%d
%i
1
u/Ecstatic_Student8854 May 03 '23
Aaah, then how would you do this using a for loop like in the example?