C - Functions - Discussion

You Are Here :: Home > C > Functions - Discussion

 



Q.

main()

{
int z=4;
printf("%d",printf("%d%d",z,z);
}

A. 4 4 4 B. 4 4 3
C. 2 4 4 D. 2 2 2

Answer: Option B
Explaination:

Here the inner printf() is executed first, and it prints out a 4, a space and another 4. Thus it totally prints out 3 characters. Whenever the printf() function is called it returns the number of characters it has successfully managed to print.



Discussion

Your Comments Goes here...
NameDiscussion