function calling with pre decrement condition in if

Posted by thulasi on Stack Overflow See other posts from Stack Overflow or by thulasi
Published on 2010-06-07T12:12:07Z Indexed on 2010/06/07 12:22 UTC
Read the original article Hit count: 306

Filed under:
void display(int a)
{
  printf("\n%d",a);
  if(--a)
    display(a);
  printf("\n%d",a);
}

main()
{
  display(4);
}

Please explain the above program. i can't understand.what is the output.ya sir i got oupt like this 4 3 2 1 0 1 2 3 how is it sir

© Stack Overflow or respective owner

Related posts about c