1 votes 1 votes main( ) { double x, d = 5.0; int y ; x = d * (x = 2.5/d); printf(“x=%lf\n”,x); x = d*(y=(int)2.5+1.5); printf("x=%lf y=%d\n",x,y); } What is output of above program? mohitbawankar asked Dec 12, 2017 mohitbawankar 238 views answer comment Share Follow See 1 comment See all 1 1 comment reply joshi_nitish commented Dec 12, 2017 reply Follow Share x = d * (x = 2.5/d); above statement will give undefined behavior, because it is modifying value of 'x' more than once b/w a sequence point. 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes d=5.0 x=5.0 *(x=2.5/5.0) =2.5 {first printf output} x=5.0 *(y=2+1.5) = 5.0*(y=3.5) x=15.0 y=3 {second printf output} Akash Mittal answered Dec 12, 2017 Akash Mittal comment Share Follow See all 0 reply Please log in or register to add a comment.