3 3 votes Choose the correct operators to fill in the blanks: int i,j,k; i=1;j=2;k=3; printf("%d",i___5___j___2____k); Output is: $2$ + % – + * / – + + % + / * % – / Programming in C tbb-programming-2 programming-in-c operators output + – Bikram 776 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 3 3 votes precedence *,/,% L->R +,- L->R A) i+5%j-2+k i+1-2+k = 2-2+k = 0+k = 3 B) i * 5 / j - 2 + k 5/j-2+k = 2-2+k = 0+k = 3 C) i +5% j +2 /k i+1+2/k = i+1+0 = 2 D) i * 5% j -2/ k i*5 %2 -2/k =5%2 - 2/k = 1 - 2/3 = 1 - 0 = 1 So, answer is option C . Learner_jai answered Jun 11, 2017 • selected Jun 12, 2017 by Bikram Learner_jai comment Share Follow See all 4 Comments 4 4 Comments reply Bikram commented Jun 12, 2017 reply Follow flag @jai Sorry, output would be 2 , can you check it now ? 1 1 replyShare Learner_jai commented Jun 12, 2017 reply Follow flag @Bikram sir , still i am getting 2 in option C as well as in D 1 1 replyShare Bikram commented Jun 12, 2017 reply Follow flag @jai For option D * % - / i * 5% j- 2 /k = (i * 5) %j - 2 / k =( (1 * 5 ) % 2 ) - (2 /k ) = (5 % 2 ) - (2/k) = 1 - ( 2/3) = 1 - 0 = 1 so for option D we are getting 1 . Hence for only option C , we get value 2 . 2 2 replyShare VIKRAM KASANA commented Dec 20, 2017 reply Follow flag sir why you putting (2/3) to zero ?? 0 0 replyShare Please log in or register to add a comment.