Views: 150
Following program shows you how to calculate interest.
In this program we get investment, interest rate and time from user and calculate interest using following formulaInterest = investment X interestRate X time / 100
#include <stdio.h>
int main() {
int investment;
int interestRate;
int time;
printf("Enter investment:");
scanf("%d", &investment);
printf("Enter interest rate:");
scanf("%d", &interestRate);
printf("Enter number of years:");
scanf("%d", &time);
int interest = investment * interestRate * time / 100;
printf("Interest amount is: %d", interest);
}
Output:
Enter investment: 10000
Enter interest rate: 24
Enter number of years: 3
Interest amount is: 7200
On By
Navya
Top Tutorials
492.5K
31.9K
21.7K
18.7K
18.6K
6.7K
6.6K
4.9K
3.3K
3.1K
Top Questions
18.6K
14.5K
8.3K
6.5K
6.1K
5.7K
4.8K
4.8K
4.3K
3.9K
Top Articles
1.9K
1.6K
944
Top Blogs
792
778
52
Top News
748
683
669
397
381
377