#include <stdio.h>
#include <math.h>
int main()
{
int n = 0;
int K = 0;
int p = 0.03;
double Kn1 = 0;
double Kn2 = 0;
double x = 0;
double y = 0;
printf(" Zinsprogramm \n");
printf(" ------------ \n\n");
printf(" Bitte Laufzeit in Jahren eingeben:\n"); //insert runtime in years
scanf("%d", &n);
printf(" Bitte Kapital eingeben:\n\n"); //insert your capital
scanf("%d", &K);
printf(" Der Zins betraegt 3%%.\n"); //interest rate is 3%
Kn1 = K*(1+p);
x = Kn1;
y = n;
Kn2 = pow( x, y );
printf(" Nach %d Jahren ist ihr Kapital auf %lf gestiegen",n ,Kn2);
//after x years your capital has risen to y
printf("\n");
printf("\n");
printf("\n");
printf("\n");
return 0;
}
@Peter87 The "not working" part is, it outputs 3200000000000000000000 instead of 23000
@Moschops int p = 0.03; wasnt supposed to be an int, it was a double before but i tried some things and thought they might fix it and forgot to change that one back.
@Aceix I pretty much started with C about 2 weeks ago in school but my teacher is to lazy or doesn't know how to make this work. Does making it a float require me to change anything else except for that and the placeholders?