Lab 2 Arithmetic in C 35 pts Name Class Day Time Due Date Lab 2 Arithmetic in C What value is stored into the integer variable num after each of the following expressions has been evaluated Show each step as the compiler would evaluate it ROUND EACH FLOAT TO 2 DECIMAL PLACES Assume the following declaration int num 1 num 2 0 3 0 9 55 num final value stored 2 num 12 8 6 num final value stored 3 num 1 25 5 4 0 num final value stored Write C combined operators to perform the following 4 Add 22 to n1 store the result in n1 5 Multiply n2 12 n3 and n1 store the result in n1 6 Find the remainder of n3 divided by 3 n1 store the result in n3 rev S 10 1 of 2 CS 1B Lab 2 Arithmetic in C CS 1B 7 Given the following piece of code evaluate the expressions and determine what would be stored in the following variables SHOW YOUR WORK ie Show how each value changes int main int a b c d e f 1 2 3 4 a b c d 2 4 6 8 5 6 7 8 a c d a c e c a 6 f a b c d return 0 a b c d e f 1 2 3 4 5 6 7 8 Final Values rev S 10 2 of 2
View Full Document