The output of int(x^2,1,3) and quad(‘x. ^2,1,3) is ________

The output of int(x^2,1,3) and quad(‘x. ^2,1,3) is ________
A. Same
B. Different
C. Maybe different
D. Error
 
Answer: b
Explanation: The output for int(x^2,1,3) will be 26/3. The output for quad(‘x. ^2’,1,3) is 8.6667. Hence we find that each output will be different. The int command will return a fractional form while the quad command will return a decimal form up to 4 places of decimal, rounded up to the 4$^{th}$ decimal place.
Output:
For int(x^2,1,3): 26/3
For quad(‘x. ^2’,1,3) : 8.6667
 

Tìm kiếm

Back
Top