im trying to learn c++ for the first time and have difficulties with a program where the user writes how much he wants to put in each year, what saving goals he wants to achieve, and his interest rate in percent. i want the loop to figure out how many years it would take and how much he would end up with exactly.
would somone please help me?
#include<iostream>
using namespace std;
int main(){
cout << "how much do you want to put in:";
int in;
cin>>in;
cout<< "how much do you want to save:";
int save;
cin>> save;
cout<< "what is your interest rate in percent: ";
double percent;
cin>> percent;
int total = in*(percent/100+1)
;
while ( total <= save){
totalt+totalt;