Answer to Question #53468 in C for rajashree g.s.
printf("\n %d %d %d",k==35,k=50,k>40);
please sir explain the logic behind this program clearly.
First the variable of type integer 'k' assigned the constant of 35
Second to the function 'printf' four parameters are passed. The first parameters is the string which state, what types of variables we want to display (formatting string). The remained three are the logic opperations that return result.
Command k==35 checks on equality the value of k and the constant 35. k=50, assigns value 50 to k and returns assigned value. The 'k>40' checks if k more than 40 and displays 1 if it satisfies the requirements.
The trick is in the fact that commants are executed from right to left, so the k>40 will be executed first, yielding the result of false ('0').
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
please use panel for submitting new questions
printf("%d %d %d ",x++,++x,x++);
//solve this and explain this if possible.
Sear shivangi, please use panel for submitting new questions.
int x = 10, y = 20 ;
if ( x == y ) ;
printf ( "\n%d %d", x, y ) ;
Considering the expert's answer, the output will be:
0 50 0
printf("\n %d %d %d",k==35,k=50,k>40)
what is the output of this program sir. Here k is already assigned the value 35 know sir.please explain the logic sir.