C parameter passing sequence



What is the Output Of Following Program ?

#include<stdio.h>
void funct(int x,int y,int z)
{
printf("%d%d%d",x,y,z);
}
void main()
{
int var=15;
funct(var,var++,++var);
}

Output :

17 16 16

Explanation :

  1. In C Programming Parameters are Passed In Right to Left Direction.

Sequence of Passing Parameters -

First  : ++var   : Value = 16
Second : var++   : Value = 16
Third  : var     : Value = 17