About 386,000 results
Open links in new tab
  1. Format Specifiers in C - GeeksforGeeks

  2. Format Specification Syntax: `printf` and `wprintf` Functions

  3. 123

    Format specifiers in C are used to define the type of data to be printed or scanned. They always start with a % symbol and are used in functions like printf() and scanf()1.

    Example

    #include <stdio.h>

    int main() {
    int num = 10;
    float fnum = 5.25;
    char ch = 'A';
    char str[] = "Hello";

    printf("Integer: %d\n", num);
    printf("Float: %f\n", fnum);
    printf("Character: %c\n", ch);
    printf("String: %s\n", str);

    return 0;
    }

    Common Format Specifiers

    1. %d: Signed integer.

    2. %u: Unsigned integer.

    3. %f: Floating-point number.

    4. %c: Character.

    5. %s: String.

    6. %x: Hexadecimal integer.

    7. %o: Octal integer.

    8. %p: Pointer address2.

    Example of Different Specifiers

    Was this helpful?

    See results from:

  4. Format Specifiers in C - Educative

    Simply put, a format specifier defines the data type involved when accepting an input or printing an output. While format specifiers can be found in numerous languages, in this blog, we'll focus solely on format specifiers in C and learn …

  5. printf, fprintf, sprintf, snprintf, printf_s, fprintf_s, sprintf_s ...

  6. Format Specifiers in C - freeCodeCamp.org

  7. C Format Specifiers - W3Schools

  8. People also ask
  9. Why Do We Use Format Specifiers in C? - Online Tutorials Library

  10. Format Specifiers In C Language | Syntax with …

    Jun 30, 2023 · Format Specifiers In C. A Format specifier is an operator that is used with the input, output function (Ex – printf (), scanf ()) to specify the size and data type of the data stored inside a Variable.

  11. Format Specifiers in C - W3Schools

  12. C Format Specifiers - Tutorialsbook

  13. Some results have been removed