I am experimenting with this C code:
#include <stdio.h>
int main()
{
int a = {6};
printf("%d", a);
return 0;
}
It prints 6. Same is the case with below code:
#include <stdio.h>
int main()
{
int a = (6);
printf("%d", a);
return 0;
}
But how this code is generating the output:
#include <stdio.h>
int main()
{
int a = (2, 3, 4, 5); // or {2, 3, 4, 5} in place of parenthesis
printf("%d", a--);
printf("%d", --a);
return 0;
}
It prints 53. Why it is considering the last value 5 for int variable a (when it is enclosed in parenthesis)? Also, why 2 for int variable a when it is enclosed in curly braces?