You can also simply output the single characters with putchar(), no need to call the variadic printf to output a fixed character within the format string (though a good compiler would likely make the optimization for you.
You can do something similar to:
#include <stdio.h>
#include <limits.h>
int main (void) {
unsigned n;
fputs ("enter an integer number: ", stdout);
if (scanf ("%u", &n) == 1) {
for (unsigned i = 0; i < n; i++) {
printf ("%d == ", i);
for (unsigned s = 0; s < sizeof s * CHAR_BIT; s++)
putchar ((i >> (31 - s)) & 1u ? '1' : '0');
putchar ('\n');
}
}
}
Example Use/Output
$ ./bin/binslessthann
enter an integer number: 10
0 == 00000000000000000000000000000000
1 == 00000000000000000000000000000001
2 == 00000000000000000000000000000010
3 == 00000000000000000000000000000011
4 == 00000000000000000000000000000100
5 == 00000000000000000000000000000101
6 == 00000000000000000000000000000110
7 == 00000000000000000000000000000111
8 == 00000000000000000000000000001000
9 == 00000000000000000000000000001001
(of course there is no need for the full 32-bits for small numbers, but they were included for completeness)
Unpadded Binary Representation
As noted in the comments, an unpadded version makes the results much easier to read. (the quote was "horrible leading zeros") To output the unpadded version, you can simply check first if the value is zero, if so simply output zero, for values with ones-bits present, you check whether ones bits remain in the value after the shift, if so, continue outputting bits, otherwise don't output anything further, e.g.
int main (void) {
unsigned n;
fputs ("enter an integer number: ", stdout);
if (scanf ("%u", &n) == 1) {
for (unsigned i = 0; i < n; i++) {
printf ("%d == ", i);
if (!i)
putchar ('0');
else {
unsigned s = sizeof s * CHAR_BIT;
while (s--) {
unsigned remain = i >> s;
if (remain)
putchar ((i >> s) & 1u ? '1' : '0');
}
}
putchar ('\n');
}
}
}
Example Use/Output
$ ./bin/binslessthanrem
enter an integer number: 10
0 == 0
1 == 1
2 == 10
3 == 11
4 == 100
5 == 101
6 == 110
7 == 111
8 == 1000
9 == 1001
Look things over and let me know if you have further questions.