Sign in
Log inSign up

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;
}
Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct