Put an l
(lowercased letter L) directly before the specifier.
unsigned long n;
long m;
printf("%lu %ld", n, m);
More Related Contents:
- What is the argument for printf that formats a long?
- How to printf “unsigned long” in C?
- in c printf() returns what [closed]
- What does %d mean? Why d and not another letter? [closed]
- char c[]=”Albus”; printf(“%c”, c); [closed]
- Correct format specifier for double in printf
- printf(“%p”) and casting to (void *)
- C/C++ printf() before scanf() issue
- Printf variable number of decimals in float
- How to format a number using comma as thousands separator in C?
- Printing UTF-8 strings with printf – wide vs. multibyte string literals
- What does “%.*s” mean in printf?
- How to printf a memory address in C
- printf specify integer format string for float
- How to format strings using printf() to get equal length in the output
- How to control the number of exponent digits after ‘e’ in C printf %e?
- C: Casting minimum 32-bit integer (-2147483648) to float gives positive number (2147483648.0)
- Unsigned values in C
- Variable sized padding in printf
- How to combine two 32-bit integers into one 64-bit integer?
- Centering strings with printf()
- printf of a size_t variable with lld, ld and d type identifiers
- Scanf/Printf double variable C
- Why does “printf” not produce any output?
- Printing chars and their ASCII-code in C
- What happens when I assign long int to int in C?
- colorful text using printf in C
- Turbo C++: Why does printf print expected values, when no variables are passed to it?
- What is the difference between %f and %lf in C?
- Is sprintf(buffer, “%s […]”, buffer, […]) safe?