#include <stdio.h>
int main()
{
int i=43;
printf("%d\n",printf("%d",printf("%d",i)));
return 0;
}
gaurav252
0
Newbie Poster
Recommended Answers
Jump to PostDoes it compile and run?
Read the documentation of printf, and you will understand if it is a valid program or not.
Jump to PostYes it is valid
because printf return number of written characters. but if printf did not return a value, this program would be valid.
this case is alittle hard to explain. %d in formatting string will look for suitable parameter, but if can not find it will put …
All 6 Replies
WolfPack
491
Posting Virtuoso
Team Colleague
VatooVatoo
21
Light Poster
Hamrick
150
Posting Whiz
Aia
1,977
Nearly a Posting Maven
Hamrick
150
Posting Whiz
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.