0 votes 0 votes Rustam Ali asked Aug 24, 2018 Rustam Ali 1.3k views answer comment Share Follow See all 7 Comments See all 7 7 Comments reply Show 4 previous comments Ashish Goyal commented Aug 27, 2018 reply Follow Share a*b*c => either you do (a*b)*c or a*(b*c), result is same. So you can't identify the order of evaluation. Similarly, a+b+c =(a+b)+c=a+(b+c) a&&b&&c = (a&&b)&&c = a&&(b&&c) but in case of % => a%b%c => (a%b)%c ≠a%(b%c) therefore, based on the result, you can find out the order of evaluation. @Rishav Kumar Singh Is my answer correct? 0 votes 0 votes Shaik Masthan commented Aug 27, 2018 reply Follow Share @Ashish Goyal brother order of evaluation means, which one evaluates first, it doesn't depend upon result. in C, they defined the order of evaluation for only 4 operators 1) expr1 && expr2 ====> expr1 evaluates first if it true then only expr2 evaluates 2) expr1 || expr2 ====> expr1 evaluates first if it false then only expr2 evaluates 3) expr1 , expr2 ====> expr1 evaluates first then expr2 evaluates and return the value of expr2 4) expr1 ? expr2 : expr3 ====> expr1 evaluates first if ( it true then only expr2 evaluates) else ( then only expr3 evaluates ) 2 votes 2 votes Ashish Goyal commented Aug 29, 2018 reply Follow Share @Shaik Masthan Thanks for the elaboration. I misunderstood the question. It is clear now 0 votes 0 votes Please log in or register to add a comment.
Best answer 1 votes 1 votes The answer is && i.e. option D since the order of evaluation for the operator & & is defined by the language whereas * and + will be evaluated depending on the type of Associativity. ank73811 answered Aug 24, 2018 selected Aug 25, 2018 by Rustam Ali ank73811 comment Share Follow See all 0 reply Please log in or register to add a comment.