General doubt regarding initialisation and declaration

what is wrong if int p=1 is declared inside while loop

hello @Sunkumsav
please share the code that u r referring to.

no u cant initialise it with while loop.
because then for every iteration value p will be 1.
which we dont want.