Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

o/p of: c = printf("%d%d", a, b);

pnkprzpnkprz Posts: 2Member
int main()
{
int a,b,c;
a=b=5;
c=printf("%d%d",a,b); //line 5
printf("%d",c);
return 0
}

what will be the output of this C program..Please explain how line 5 works.

Comments

  • jhavineet974jhavineet974 Posts: 2Member
    o/p=554
    /*line 5-prototype and definition of printf()is defined in stdio.f file
    on execution it will first print 55.on executing second printf(),since the return type of printf() is the number of characters(along with format specifier) it has printed and since here 4 values has been printed so 4 will be assigned to c and hence printed out*/
Sign In or Register to comment.