My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

What will be the output of this c language program?

Ankur Singh's photo
Ankur Singh
·Dec 23, 2020·

1 min read

What will be the output of following c program, and why?

#include <stdio.h>

int main()
{
    int a=10;
    int b=0;
    b=++a + a++ + ++a + a++ + ++a;
    printf("%d",a);
    printf("\n%d",b);

    return 0;
}