C languageC SolutionChapter 4Programming

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

Program: 113

When interest compound q times per year at an annual rate of r % for n years, the principal p compounds to an amount a as per the following formula:

a=p(1+r/q)nq

Write a c program to read 10 sets of p, r, n & q and calculate the corresponding as.

Output:

Set: 1
Enter Principle: 1000
Enter Rate: 10
Enter Time(in year): 1
Enter Compound Interest: 1
Amount: 11000.00

Set: 2
Enter Principle: 2000
Enter Rate: 10
Enter Time(in year): 1
Enter Compound Interest: 1
Amount: 22000.00

Set: 3
Enter Principle: 100
Enter Rate: 1
Enter Time(in year): 1
Enter Compound Interest: 1
Amount: 200.00

Set: 4
Enter Principle: 200
Enter Rate: 5
Enter Time(in year): 1
Enter Compound Interest: 5
Amount: 6400.00

Set: 5
Enter Principle: 622
Enter Rate: 2
Enter Time(in year): 4
Enter Compound Interest: 1
Amount: 50382.00

Set: 6
Enter Principle: 200
Enter Rate: 1
Enter Time(in year): 1
Enter Compound Interest: 10
Amount: 518.75

Set: 7
Enter Principle: 355
Enter Rate: 45
Enter Time(in year): 1
Enter Compound Interest: 21
Amount: 9863834894336.00

Set: 8
Enter Principle: 515
Enter Rate: 5
Enter Time(in year): 1
Enter Compound Interest: 12
Amount: 33652.66

Set: 9
Enter Principle: 110
Enter Rate: 1
Enter Time(in year): 1
Enter Compound Interest: 1
Amount: 220.00

Set: 10
Enter Principle: 200
Enter Rate: 2
Enter Time(in year): 3
Enter Compound Interest: 2
Amount: 12800.00

Lokesh Kumar

Being EASTER SCIENCE's founder, Lokesh Kumar wants to share his knowledge and ideas. His motive is "We assist you to choose the best", He believes in different thinking.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.