Write a C program to input principle (amount), time and rate (P, T, R) from user and find Simple Interest. How to calculate simple interest in C programming if principle, time and rate are given by user. C program for Simple Interest.

Input principle: 1200

Input time: 2

Input rate: 5.4

Output Simple Interest = 129.600006

Principle * Time * Rate / 100

Happy coding ;)

**Example:**Input principle: 1200

Input time: 2

Input rate: 5.4

Output Simple Interest = 129.600006

### Required knowledge

Fundamentals of C, Data types, Talking user input in C#### Simple Interest

Simple Interest can be given by the formula:Principle * Time * Rate / 100

### Program

/** * C program to calculate simple interest */ #include <stdio.h> int main() { float amount, time, rate, SI; // Read principle, rate and time from user printf("Enter principle (amount): "); scanf("%f", &amount); printf("Enter time: "); scanf("%f", &time); printf("Enter rate: "); scanf("%f", &rate); // Calculates simple interest SI = (amount * time * rate) / 100; printf("\nSimple Interest = %f", SI); return 0; }

Output

Enter principle (amount): 1200

Enter time: 2

Enter rate: 5.4

Simple Interest = 129.600006

Enter time: 2

Enter rate: 5.4

Simple Interest = 129.600006

Happy coding ;)

### You may also like

- Basic programming exercises index.
- C program to calculate Compound Interest.
- C program to count total number of notes in a given amount.
- C program to check for profit and loss.
- C program to calculate total, average and percentage.
- C program to convert length from centimeter to meter and kilometer.
- C program to convert temperature from Fahrenheit to Celsius.
- C program to convert days to years, weeks and days.
- C program to check whether a number is negative, positive or zero.

The moon’s gravity is about 17 percent of Earth’s. Write a program that allows you to enter your weight and computes your effective weight on the moon.

ReplyDelete