Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem 2 (7 points): Answer the following questions w.r.t. the dbz function shown below. 1 void dbz(int ci, int c2, int c3){ (a) Assume al
Problem 2 (7 points): Answer the following questions w.r.t. the dbz function shown below. 1 void dbz(int ci, int c2, int c3){ (a) Assume al = 10 and a2 = 20. What are the int x,d,y,z; possible values of d at the end of the program? X = a1+a2; (2 points) d = a1; (b) Use the information you computed in (b) to if(c1) find values (cl,c2,c3) that cause the division- X = a1; by-zero vulnerability. (1 point) else d = a2; (c) Assume c3 = 1 i.e. if(c3) evaluates to true. if(c2) { Assume al,a2 to be non-zero unsigned integers. if(C3) Are there values (al,a2) which can cause the y = a1; vulnerability? If yes, then what are those? If no, else d = d-a1; then argue why that can't be the case. (2 points) NM A LOOOOood ba else d = d+1; z = x/d; (d) Repeat the exercise (C) with the assumption that al and a2 are non-zero signed integers. (2 points) 16 }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started