I have searched but i can not seem to find an answer to my problem.
I have to write a program that lets the user enter their salary, and calculates their salary with a 5% raise for 3 years.
When I run the program and enter the value for cSalary the program just closes. (This is a console app by the way.)
The compiler I am using is Dev C++.
This is the code I have now, which the compiler is saying is correct:
// Exercise 29 Pg.260
#include <iostream>
using namespace std;
int main()
{
double cSalary = 0.0;
const double raise = cSalary * 0.05;
double nSalary = cSalary + raise;
cout <<"Enter current salary: ";
cin >>cSalary;
for(int counter = 0; counter <=3; counter++)
{
cout <<nSalary<<endl;
cSalary = nSalary;
}
return 0;
}
Any help is appreciated.