Program was wrong added the changes to make it right

Remember it is multiplication by squaring.

Signed-off-by: anish kumar <anish198519851985@gmail.com>