- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C Program for simple interest?
Simple Interest is the product of principal amount, rate of interest and the time duration (in years) by 100.
Example,
Input − p=5, r=4, t=5
Output − 1
Explanation: Simple Interest = (Principal Amount * Rate of Interest * Number of years) / 100
SI= 5*4*5/100 = 1
Example
#include<iostream> #include <stdio.h> using namespace std; int main() { //principle amount float p = 5; //time float r = 4; //rate in years float t = 5; // Simple interest float SI = 0; SI =(p * t * r) / 100; printf("Simple Interest = %f ",SI); return 0; }
Output
Simple Interest = 1.0000
Advertisements