# urgent logic for x to the power y

hi all,

i need logic for writing a program to calculate x to the power y.

example - if x = 2 & Y = 3.

then 2 to the power 3 will be 8.means 2 cube = 8.

plz help me

thanks

i will award ur efforts.

sanjeev

##### Tags:

##### Guest replied

Hi Sanjeev,

do this way

Data : x type P value 5. DAtA : y type P. y = x ** 3. Write :/ x, y.