Write a program to accept side of a square. calculated and display the area, perimeter or diagonal of a square as per the user's choice. Enter 'a' to calculate area of a square enter 'p' to calculate perimeter of a square and enter 'd' to calculate diagonal of a square.
(Hint : Area =(side)² Perimeter =4×side Diagonal = ✓2×(side))
Write a Java expression
Answers
Answered by
0
Explanation:
k=int(input("enter side of a square: "))
a=k²
p=4k
d=√2k
print("Area of square is: "))
print("Perimeter of square is: "))
print("diagonal of square is: "))
hope it helps u
Similar questions
Social Sciences,
3 hours ago
Political Science,
3 hours ago
Math,
6 hours ago
Math,
6 hours ago
Math,
8 months ago