CBSE Class 11 Computer Science Question 151 of 173

Data Handling — Question 3

Back to all questions
3
Question

Question 3

Write a program to obtain x, y, z from user and calculate expression : 4x4 + 3y3 + 9z + 6π

Solution
import math

x = int(input("Enter x: "))
y = int(input("Enter y: "))
z = int(input("Enter z: "))

res = 4 * x ** 4 + 3 * y ** 3 + 9 * z + 6 * math.pi

print("Result =", res)
Output
Enter x: 2
Enter y: 3
Enter z: 5
Result = 208.84955592153875
Answer