What's the use of %h , %u , %i when we can simply use %d for all the purposes.
For example;
Code:
#include <stdio.h>
int
main() {
printf("%h",78);
printf("%d",78);
printf("%i",8909);
printf("%d",8909);
printf("%u",65530);
printf("%d",65530);
}
as we can see we can use %d in place of %h,%i,%u , i know that they are used as modifiers for short int(h) , decimal , octal , hexadecimal interger(i) , and unsigned decimal integer(u)
so what's there purpose? I can't find any benefit or distinction in their usage. Please help!!