i first course in programming c++, , don't know why program doesn't work correctly. able me? there way know how many loop round did before loop stops (that is, when p = 0 in case)?
#include <iostream> using namespace std; int main() { float p, i, m; cout << " indiquer le montant du prêt($), le taux d'intérêt par an(%), et le payement mensuel($) :"; cin >> p >> >> m; { float * s; s = &(p*i/12*100); cout << p-(m-s); } while (p != 0) return 0; }
when using do...while loop, while should end ';'.
do { float s; s = (p*i/12*100); cout << p-(m-s); } while (p != 0);
and ignore pointers, because there no need of it...
Comments
Post a Comment