Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

If the variable a, b, and c, have been declared as type int and have the values

ID: 3613349 • Letter: I

Question

If the variable a, b, and c, have been declared as typeint and have the values 4, 5, and 2 respectively, evaluatethe following expressions as they would be evaluated on yoursystem: (Note: this is a two-part question)    part one  1)  a % b - 5                  2)   c - b * a                  3)   c * c + b * a % b                  4)   a - b - c * a % b    part two   To verify youranswer to part one, write a short program in C that                  declares and initialzes a, b, and c and outputs the values of thefour                  expressions. (Note: write this C program inUNIX) If the variable a, b, and c, have been declared as typeint and have the values 4, 5, and 2 respectively, evaluatethe following expressions as they would be evaluated on yoursystem: (Note: this is a two-part question)    part one  1)  a % b - 5                  2)   c - b * a                  3)   c * c + b * a % b                  4)   a - b - c * a % b    part two   To verify youranswer to part one, write a short program in C that                  declares and initialzes a, b, and c and outputs the values of thefour                  expressions. (Note: write this C program inUNIX)

Explanation / Answer

If the variable a, b, and c, have been declared as typeint and have the values 4, 5, and 2 respectively, evaluatethe following expressions as they would be evaluated on yoursystem: (Note: this is a two-part question)    part one  1)  a % b - 5
                                         4%5-5
                                         4-5 = -1
                 2)   c - b * a
                                         2-5*4
                                       2-20
                                         -18
                 3)   c * c + b * a % b
                             2*2+5*4%5
                              4+20%5
                              4+0
                               4
                 4)   a - b - c * a % b
                               4-5-2*4%5
                                 4-5-8%5
                                 4-5-3
                                   -4
   part two   To verify youranswer to part one, write a short program in C that                  declares and initialzes a, b, and c and outputs the values of thefour                  expressions. (Note: write this C program inUNIX)