+ 2
Why did the output is 01?
How did n becomes 1? Explain the process please int main(){ int n=printf("0"); printf("%d",n);
3 Respuestas
+ 12
printf() returns the number of characters inserted into the output stream, which may serve as a useful tool for error detection:
https://en.cppreference.com/w/c/io/fprintf
+ 1
printf returns the number of characters successfully written or a negative number if it fails
+ 1
First printf will print normally 0 then it will assign to n after that next printf will return total numbers of characters which u have written under double quotes with whitespaces if u will give space or u will write any chars like special symbols @ ,_,!...... It will also be count
Int n= printf("hello");
Here total chars are 5 and in printf u use %d so it will print integer values if u will write %x then it will print hex values.