K
karthikbalaguru
Hi,
I get a strange output with the below code snippet.
#include<stdio.h>
int main(void)
{
int r=2,s=3,x=0,t=7;
x=(r,s,t);
printf("x values is %d \n",x);
return 0;
}
I get the output as 7.
It looks to be dependent on 't'.
If i change the value of t as 5, the output is 5.
How does it give 7 as ouput ? Any reasons for
the dependency on 't' variable ?
Does C support this kind of assignment of x=(r,s,t);
for any specific reasons ?
Thx in advans,
Karthik Balaguru . T
I get a strange output with the below code snippet.
#include<stdio.h>
int main(void)
{
int r=2,s=3,x=0,t=7;
x=(r,s,t);
printf("x values is %d \n",x);
return 0;
}
I get the output as 7.
It looks to be dependent on 't'.
If i change the value of t as 5, the output is 5.
How does it give 7 as ouput ? Any reasons for
the dependency on 't' variable ?
Does C support this kind of assignment of x=(r,s,t);
for any specific reasons ?
Thx in advans,
Karthik Balaguru . T