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

 /* #include<stdio.h>

int main()

{

int i;

while(i<=10)

{

printf("%d\n",i++,i);

}

return 0;

} */

// write a program to generate all combinational of 1,2 and 3 using for loop

 /* #include<stdio.h>

int main()

{

int i=1,j=1,k=1;

for(i=1;i<=3;i++)

{

for(j=1;j=3;j++)

{

for(k=1;k<=3;k++)

printf("%d%d%d\n",i,j,k);

}

}

return 0;

} */


// Write a program to print the multiplication table of the number entered by the user.The table should get displayed in the following form:-

// 29*1=29

// 29*2=58


 /*  #include<stdio.h>

int main()

{

int i=1,num;

printf("Enter a number:");

scanf("%d",num);

while(i!=11)

{

printf("%d*%d=%D\n",num,i,num*1);

i++;

}

return 0;

}   */

/* when interest compoundes q times per times per year at an annual rate of r% for n years,the 

principle P compounds to an amount a as per the followng formula

  a=p(1+r/q)^nq

  Write a program to read ten sets of p,n,r and q and calculate the corresponding as.*/

  

  #include<stdio.h>

  #include<math.h>

  

  int main()

  {

  float p,n,r,q,a;

  for(i=1;i<=10;i++)

  {

  printf("set=%d\n",i);

  printf("Enter principle:");

  scanf("%f",&p);

  printf("Enter Rate:");

  scanf("%f",&r);

  printf("enter time(in year):");

  scanf("%f",&n);

  printf("Enter compound interest:");

  scanf("%f",&q);

  a=p*(pow(1+r/q),n*q ));

  printf("Amount=%2f\n\n",a);

 

  }

  return 0;

  }




Post a Comment

0 Comments