Code:
#include <stdio.h>
int main ()
{
int day = 1;
float amount = .01;
while (day <= 31){
printf ("Day:%d \t Amount:$%.2f\n", day, amount);
amount *= 2;
day++;
}
printf ("-----------------------------------------------------------\n");
day = 1;
amount = .01;
while (day <= 31){
printf ("Day:%d \t Amount:$%.2f\n", day, amount);
amount * 2;
day++;
}
return 0;
}
So yeah it's two kind of examples. Just curious about the logic behind
and
Why did it not multiply in the 2nd while loop while in the first it multiplied. I mean it's somewhat the same right? What amount *= 2 is saying to amount * 2? Just confused.