The number of characters output is 5. 1000
is four characters. \n
is one character.
printf
doesn’t return the number of “items” output like the scanf
family of functions do for input. It returns the actual character count.
More Related Contents:
- How to know the do while loop in C programming [closed]
- C modify global char array [closed]
- Semicolon and Comma in C [closed]
- Fast way to tokenize a string in c
- Why can’t we use double pointer to represent two dimensional arrays?
- Preventing console window from closing on Visual Studio C/C++ Console application
- What does the ‘array name’ mean in case of array of char pointers?
- Point in Polygon Algorithm
- Convert a preprocessor token to a string
- C optimisation of string literals
- Read no more than size of string with scanf()
- srand(time(NULL)) doesn’t change seed value quick enough [duplicate]
- Get a timestamp in C in microseconds?
- Input in C. Scanf before gets. Problem
- Recursive declaration of function pointer in C
- Type to use to represent a byte in ANSI (C89/90) C?
- Confusion regarding modification of const variable using pointers
- Macro to count number of arguments
- How to check if a pointer is valid? [duplicate]
- Calling a script from a setuid root C program – script does not run as root
- How do I use setsockopt(SO_REUSEADDR)?
- Why can we not declare a variable after a switch case colon without using curly braces?
- Using getchar() in a while loop
- Is it possible to print out only a certain section of a C-string, without making a separate substring?
- Check if process exists given its pid
- flock(): removing locked file without race condition?
- How to make YY_INPUT point to a string rather than stdin in Lex & Yacc (Solaris)
- C11 _Generic: how to deal with string literals?
- How to print exact value of the program counter in C
- CreateDesktop() with vista and UAC on (C, windows)