C While Loop Not Working As Expected Code Is Not Fully Executed

C While Loop Not Working As Expected Code Is Not Fully Executed