S
Shivanand Kadwadkar
I far i know sequential-evaluation operator are evaluated from left
and right and it will only take the right most result
#include<stdio.h>
int main()
{
int i=0,j=2,k=5;
int ans1,ans2;
ans1=(i,j,k); // Evaluated from left to right and we assign 5 to ans1
ans2=i,j,k; // Why it is not same here that we assign 5 to ans2
printf("ans1 %d ans2 %d \n",ans1,ans2);
return 0
}
Output:
ans1 5 ans2 0
and right and it will only take the right most result
#include<stdio.h>
int main()
{
int i=0,j=2,k=5;
int ans1,ans2;
ans1=(i,j,k); // Evaluated from left to right and we assign 5 to ans1
ans2=i,j,k; // Why it is not same here that we assign 5 to ans2
printf("ans1 %d ans2 %d \n",ans1,ans2);
return 0
}
Output:
ans1 5 ans2 0