Why my Fast power code giving wrong answers?

at line no 12
if (p & 1)

this is correct statement
not n&1

1 Like