For the values given, what will c contain after executing the following?int a=9,
ID: 3664308 • Letter: F
Question
For the values given, what will c contain after executing the following?int a=9, b=4, c=-1; c-=a%b; For the values given, what will c contain after executing the following?Int a=9, b=4, c=-1, d=2; c=--a/b-c*d;
For the values given, what will c contain after executing the following?int a=9, b=4, c=-1; c-=a%b; For the values given, what will c contain after executing the following?
Int a=9, b=4, c=-1, d=2; c=--a/b-c*d;
For the values given, what will c contain after executing the following?
Int a=9, b=4, c=-1, d=2; c=--a/b-c*d;
Explanation / Answer
1) int a=9, b=4, c=-1; c-=a%b;
Since a%b = 1
c-=a%b; ---------> c -= 1
Therefore, finally c = -2.
2) Int a=9, b=4, c=-1, d=2; c=--a/b-c*d;
--a ----------> a = a-1 -------------> a=8
a/b = 2
c*d = -2
a/b-c*d = 4
c = --a/b-c*d
Therefore, finally c = 4
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.