Question: ( ii ) a = 1 , b = 0 , c = 0 ( iii ) a = 2 , b = 5 ,

(ii)a=1,b=0,c=0
(iii)a=2,b=5,c=1
(iv)a=1,b=4,c=1
(v)a=12,b=4
(vi)a=12,b=5
(vii)a=20,b=9
(viii) length =2, width =2
(ix) length =10, width =5
(a)
=b****2-4**a**
(d==0 :
print ("d is equal to 0")
print ("real")
if (d>) :
print
print ("d is
print ("two roots")
print ("d is less than zero")
print ("imaginary")
(c)
a, b, c=eval (input ("Enter a,b,c: "))
else:
(b)
input ("values of a,b?"))
r=a%b if (r=0)
if (r==0 : print ("The remainder is zero")
else: print ("The remainder is non-zero")
print ("The remainder is non-zero") print ("Remainder of a division b is: ", r)
(d)
length, width = eval(input("Enter length and width: "))
if (length == width):
print ("The area of the square is: ", length*length)
print ("The area of the rectangle is: ", length*width)
Exercise 3: See the four program fragments below. Determine the outputs of the fragments in for the
following sets of values for a,b, and c, and length and width. Where the body of the if and/or else is
missing fill it in.
(i)a=1,b=1,c=1
 (ii)a=1,b=0,c=0 (iii)a=2,b=5,c=1 (iv)a=1,b=4,c=1 (v)a=12,b=4 (vi)a=12,b=5 (vii)a=20,b=9 (viii) length =2, width =2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!