Suppose you save $100 each month into a savings account with the annual interes rate5%.So, the monthly interest rate is after the first month,the value in the account becomes 100(1+0.00417)=100.4417
After the second month, the value in the account becomes (100+100.417)
After the third month ,the valiue in the account becomes (100+201.252)*(1+0.00417)=302.507 and so on
Write a C++ program to display the account value after the sixth month.


That is incorrect. 100 * 1.00417 = 100.417, not 100.4417.

In any event, just a simple loop will calculate the value after N number of months.