New course! Every coder should learn Generative AI!
Try a free lesson+ 1
Q) What is the output for this code and how ?
#include<stdio.h> void main() { int n=printf("0"); printf("%d",n); }
1 Answer
+ 11
Initially printf prints 0 , the return value on successful execution of printf returns number of characters in the printf("0") since here only 1 character is there in printf() so it's 1