C Code Short Answer [Part A] Evaluate the following expressions and write your a
ID: 3752871 • Letter: C
Question
C Code Short Answer [Part A] Evaluate the following expressions and write your answers in the boxes provided 10.0+15/2 6.0 3*4.0/6+6sr ii) 10+17/3.+4 iv) 3.0*4966+6 v) 10+17%3+4.0s [Part B] Write relational expressions in C to express each of the following conditions. (10 points) (example: x is equal to 5 is the same as x=5) z is greater than or equal to 6sEP i)z is equal to x and greater than y iii)z is positive but not equal to 4 iv)z is not equal to 5 or -5sr. [Part C] Write the C code expressions for the following math equations: -b+ a 2a +1Explanation / Answer
Part A )
1) 10.0 + 7*6 = 10.0 + 42.0 = 52.0
2) 3*4.0/6 + 6.0 = 12.0/6 + 6.0 = 8.0
3) 10 + 17/3. + 4 =>10 + 5.66 + 4 = 19.66
4) 3*4%6 + 6 = 12%6 + 6 = 6
5)10 + 17%3 + 4 =>10 + 2 + 4 = 16
6) 10==16 = 0
Part B )
1) z >=6
2) z==x && z>y
3) z>0 && z!=4
4) !(z==5 || z==-5)
Part C )
1)
ans = 1/c + (1-a)/(1+b)
2)
ans = (-b + a*a) / (2*a + 1)
Thanks, PLEASE UPVOTE
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.