0
What is the output of this? Void main(){ char a[10]="walk"; printf(%d,printf(a)); getch();}
2 Answers
+ 4
Since printf() returns the total number of printed characters, and variable a stores "walk", the final output would be
walk4
Remember that void return type for main is not standard. Many compilers will not accept it. Instead, do:
#include <stdio.h>
int main()
{
char a[10] = "walk";
printf("%d", printf(a));
}
+ 6
Code Playground has the answer.