0

explain the output please

#include<stdio.h> #include<conio.h> void main(){ int z; z=(5,3,2); printf("%d",z); }

25th Dec 2016, 8:34 AM
Arpitha G R
Arpitha G R - avatar
5 Respostas
+ 2
OK thanks ayush
25th Dec 2016, 9:09 AM
Arpitha G R
Arpitha G R - avatar
+ 1
right value given in parentheses..should get assigned to Z i.e. 2
25th Dec 2016, 8:54 AM
Ayush Walekar
Ayush Walekar - avatar
+ 1
why right value is assigned to Z can u please explain ayush
25th Dec 2016, 9:01 AM
Arpitha G R
Arpitha G R - avatar
+ 1
because that's how it works..🙇 firstly 5 is assigned to Z then it reinitialized by 3.. then by 2
25th Dec 2016, 9:04 AM
Ayush Walekar
Ayush Walekar - avatar
+ 1
Z = (5,3,2) is like Z = 5; Z = 3; Z = 2;
25th Dec 2016, 9:08 AM
Ayush Walekar
Ayush Walekar - avatar