#include <iostream.h>
int main()
{
int p,t,n;
cout << "N=";
cin >> n;
p=1;
t=0;
while(p<n)
{
t=t+p;
p=p*2;
}
cout << t << endl;
cout << p << endl;
}
a)Write the statement of this code.(I know it's something about odd and even numbers, I can't figure it out)
b)For how many values of N the code outputs t=32 and p=31 (How do I solve problems like this b)?I have no idea)
c)Rewrite the code using do-while (keep the algorithm)
//I know that iostream.h is deprecated but I'm in a hurry, so excuse me.