Okey dokey...
First... please don't back edit your messages. That deprives others of the chance to learn from this experience.
Now... I added a diagnostic print to you code...
Code:
#include <stdio.h>
#include <windows.h>
int main(void)
{
int year = 0;
float ammountDaphne = 100, ammountDeirdre = 99;
while (ammountDaphne > ammountDeirdre)
{
year++;
if (year == 1)
ammountDeirdre = 100;
ammountDaphne = ammountDaphne + 0.1*ammountDaphne;
ammountDeirdre = ammountDeirdre + 0.05*ammountDeirdre;
printf("%d %.2f %.2f\n",year,ammountDaphne,ammountDeirdre);
Sleep(100);
}
printf("It took %d years for Deirdre's investment to exceed Daphne's one. Now, Deirdre has $ %.2f and Daphne has $ %.2f.\n", year, ammountDeirdre, ammountDaphne);
return 0;
}
The special symbols you are seeing are #INF meaning infinite... indicating a floating point overflow because Deidre never does catch up to Daphne...