When interest compounds q times per year at an annual rate of r % for n years, the principle p compounds to an amount a as per the following formula a = p ( 1 + r / q )^nq Write a program to read p, r, n & q and calculate the corresponding as

/*
When interest compounds q times per year at an annual rate of r % for n years, the principle p compounds to an amount a as per the following formula
a = p ( 1 + r / q )^nq
Write a program to read  p, r, n & q and calculate the corresponding as.
*/

#include<stdio.h>

int main()
    int  p,  nris
    float q,a=1.0;
    
    
    printf("Enter value of p n r q\n");
    scanf("%d%d%d%f", &p,&n,&r,&q);
    s=n*q;
    
    
    for ( i = 1i <= si++)
    {
        
        a=a*p*(1+r/q);
    }
    printf("your value is %f"a);

    return 0;
}


 

Comments