Write a python program to enter a number and display its hex and octal equivalent and its square root.

 

Write a python program to enter a number and display its hex and octal equivalent and its square root.


PROGRAM:

num=int(input("Enter a number:"))
a=num**(0.5)
print("The hex equivalent of a"+ str(num) +"is",hex(num))
print("The octal equivalent of a"+ str(num) + "is",oct(num))
print("The square root of a" + str(num) + "is",a)

OUTPUT:



No comments:

Post a Comment




Copyright Ⓒ 2022 | Mechpedia | All Right Reserved.