What is the Output of the code? And how ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the Output of the code? And how ?

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

21st Aug 2019, 1:19 PM
M.S.SHARMA
M.S.SHARMA - avatar
2 Answers
+ 2
Thanks 😊 CarrieForle
21st Aug 2019, 2:50 PM
M.S.SHARMA
M.S.SHARMA - avatar
+ 1
printf() returns the number characters that are printed. https://www.tutorialspoint.com/return-values-of-printf-and-scanf-in-c int n = printf("0") //We call the function printf() so it prints "0". and the number of characters is 1. So n is 1. printf("%d",n); //print n.
21st Aug 2019, 1:38 PM
你知道規則,我也是
你知道規則,我也是 - avatar