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

Howdy, Stranger!

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


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;
c=printf("%d%d",a,b); //line 5
return 0

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


  • jhavineet974jhavineet974 Posts: 2Member
    /*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.