1. Please help C questions Consider the assignment statement: x= (y-3) * (a + b
ID: 654574 • Letter: 1
Question
1. Please help C questions
Consider the assignment statement: x= (y-3) * (a + b / c) % That statement includes 5 different operators (+,*, -,/, %) in the expression to the right of the '='. What order would those operators be evaluated at run time? (-,/,+,*,%) (%,*,/,+,-) (+, -, *,/, %) (*,/,%,+,-) Its hard to say. The precedence of these operators is not defined by the rules of C. Consider the following variable declarations int i.j.k; double D[10] [7); char c ; which of the following "C Assignment Statements" would give a syntax error? D[i] [c] = 3.14; D[c] [i] = 3; D[1][3.14] = 3; D[i] [j] = 3.; none that is to say that all arc syntactically correct given the declarations above.Explanation / Answer
7. Answer is (a) because In operator precedence rules in C, bracket is evaluated first and - is in bracket, then / and + are also in bracket. Among / and +, the division operator has higher precedence than +, so / will be evaluated first. Then * and % have equal precedence.
8. Answer is (b) because In D[c][i]=3, c variable has char datatype and When we assign 3 to array, it goes to c by default. And c is char type, if we assign integer 3 value to it, it will show syntax error.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.