0

Here integer value is not defined but how to show the output 01

int n=printf("0"); Printf("%d",n);

23rd Aug 2020, 5:56 AM
Suparna Podder
Suparna Podder - avatar
4 Antworten
+ 4
Return Value of printf() in C: If successful, the total number of characters written is returned. On failure, a negative number is returned. Reference: https://www.tutorialspoint.com/c_standard_library/c_function_printf.htm
23rd Aug 2020, 5:59 AM
Gordon
Gordon - avatar
+ 2
01 is result of two printf() In the first line printf() prints 0, without new line Then printf("0") returns the length 1, and store in n The second line print n which is 1 So output is 01
23rd Aug 2020, 11:58 AM
Gordon
Gordon - avatar
+ 1
Gordon where negative number is here? Plz explain don't understand
23rd Aug 2020, 6:05 AM
Suparna Podder
Suparna Podder - avatar