
Write a program to read 10 sets of p, r, n & q and calculate the corresponding as.
void main()
{
float a,p,r,q,n,x,y,z,w;
a=1;
for(z=1;z<=2;z++)
{
printf("\nEnter the values of p,r,n &q");
scanf("%f%f%f%f",&p,&r,&n,&q);
x=n*q;
for(y=1,a=1;y<=x;y++)
{
a=a*(1+r/q);
}
w=a*p;
printf("\nThe value of a is %f",w);
}
}
No comments:
Post a Comment