C Exercises: Compute the simple interest
C Basic Declarations and Expressions: Exercise-53 with Solution
Write a C program that accepts the principle, rate of interest, and time and calculates simple interest.
Pictorial Presentation:

Sample Solution:
C Code:
#include<stdio.h>
int main() {
int p, r, t, int_amt;
// Prompt user to input principle, rate of interest, and time
printf("Input principle, Rate of interest & time to find simple interest: \n");
scanf("%d%d%d", &p, &r, &t);
// Calculate simple interest
int_amt = (p * r * t) / 100;
// Display the calculated simple interest
printf("Simple interest = %d", int_amt);
return 0;
}
Sample Output:
Input Data: p = 10000, r = 10% , t = 12 year Input principle, Rate of interest & time to find simple interest: Simple interest = 12000
Flowchart:

C programming Code Editor:
Previous: Write a C program to read an array of length 6 and find the smallest element and its position.
Next: Write a C program that accepts a distance in centimeters and prints the corresponding value in inches.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join