C C++ Errors Question:
Download Questions PDF

void main()
{
int i=7;
printf("N= %*d",i,i);
}

Answer:

Its output would be 7,

"%*d"

here * symbol doesn't affect of operation of %d.

so 7 is set to value in variable i.

Download C C++ Errors Interview Questions And Answers PDF

Previous QuestionNext Question
What is run time error?void main()
{
int i=5,y=3,z=2,ans;
clrscr();
printf("%d",++i + --z + i++ + --i * ++y);
i=5,y=3,z=2;
ans=++i + --z + i++ + --i * ++y;
printf("n%d",ans);
getch();
}

Its output is 37 and 31....
Please explain me why its different
How it works?