Top "Printf" questions

`printf` is a common function for formatted output.

JavaScript equivalent to printf/String.Format

I'm looking for a good JavaScript equivalent of the C/PHP printf() or for C#/Java programmers, String.Format() (IFormatProvider …

javascript printf string.format
Correct format specifier for double in printf

What is the correct format specifier for double in printf? Is it %f or is it %lf? I believe it's %…

c floating-point printf double format-specifiers
Is there a printf converter to print in binary format?

I can print with printf as a hex or octal number. Is there a format tag to print as binary, …

c printf
What is the argument for printf that formats a long?

The printf function takes an argument type, such as %d or %i for a signed int. However, I don't see …

c printf long-integer
How do you format an unsigned long long int using printf?

#include <stdio.h> int main() { unsigned long long int num = 285212672; //FYI: fits in 29 bits int normalInt = 5; printf("My …

c syntax printf format-specifiers long-long
What is the printf format specifier for bool?

Since ANSI C99 there is _Bool or bool via stdbool.h. But is there also a printf format specifier for …

c++ c boolean printf
How to printf "unsigned long" in C?

I can never understand how to print unsigned long datatype in C. Suppose unsigned_foo is an unsigned long, then …

c printf long-integer unsigned format-specifiers
printf() formatting for hex

This is more of a curious query than an important question, but why when printing hex as an 8 digit number …

c printf hex
Strings and character with printf

I was confused with usage of %c and %s in the following C program #include <stdio.h> void …

c printf