Computer Science, asked by Happyfeetme, 11 months ago

Write a program to input a number n and print n,n²,n³. Please help me

Answers

Answered by justmobilesn
1

Answer:

in which language do you want like java script, java, python, v++,c

Answered by equbalrajiya123
1

Answer:

num = int(input("ENter a number : "))

print("",num,"^2 = ",(num*num),"\n",num,"^3 = ",(num*num*num),"\n",num,"^4 = ",(num*num*num*num),sep='')

Input

ENter a number : 10

10^2 = 100

10^3 = 1000

10^4 = 10000

Explanation:

1.)First i took number into variable num using int(input()) methods, the int() method is used for taking only integer value in python.

2.)input() is used to take input from the used it takes a string as argument and that string will be displayed on the output screen when the used is giving the input

3.)after taking input i directly printer the square of the given number and cube of the number and 4rth power of the given number

4.) in print() method takes String as argument or a variable as argument, so in string argument i said num² and calculated num² before printing

5.)like that i have done for num³ and num⁴

---Hope you liked my program in python,if you liked it mark as brainliest, it would really help me.  

Similar questions