#include "stdafx.h"
#include <iostream.h>
#include <math.h>
float salary=1;
void main(){
while (salary != 0){
printf("\nEnter the salary amount or 0 to exit: ");
scanf("%f", &salary);
if (salary != 0){
& printf("\n%*d%% %*d%% %*d%% %*d%%\n", 19, 2, 9, 3, 9, 4, 9, 5);
& printf("1st year: %*0.2f %*0.2f %*0.2f %*0.2f\n", 1, salary*1.02, 1, salary*1.03, 1, salary*1.04, 1, salary*1.05 );
& printf("2nd year: %*0.2f %*0.2f %*0.2f %*0.2f\n", 1, salary*pow(1.02,2), 1, salary*pow(1.03,2), 1, salary*pow(1.04,2), 1, salary*pow(1.05,2) );
& printf("3rd year: %*0.2f %*0.2f %*0.2f %*0.2f\n", 1, salary*pow(1.02,3), 1, salary*pow(1.03,3), 1, salary*pow(1.04,3), 1, salary*pow(1.05,3) );
& }
}
}
Comments
Leave a comment