C Program to Find Simple Interest

Today, we learn on C Program to Find Simple Interest.

In mathematics, we calculate simple interest by the following formula:

Simple Interest = (Principle Amount * Rate of Interest * Time)/100

Let’s understand it with C program code

Note: After understanding below code don’t forget to read program code explanation (PCE)

C Program to Find Simple Interest

void main()
int pa,ri,t,SI;
/*Pa=Principle Amount
ri=Rate of Interest
SI=simple interest*/
printf("Enter principle Amount");
printf("Enter rate of interst");
printf("Enter total time in years");

printf("Simple Interest =%d",SI);

Program Code Explanation(PCE)

In the above program code, we understand how to calculate a simple interest using C program.

Simple Interest = (Principle Amount * Rate of Interest * Time)/100

In simple maths

In the above line, you can see this is the mathematical formula to calculate simple interest. So you need 4 different variables to calculate simple interest. As I mentioned in program code (pa,ri,t and SI)

You already know that printf() function is used to display message or output on console (monitor screen) and scanf() function is used to input values through the user.

Using scanf(), we took values of principle_amount, rate_of_interest and time from the user.

If you don’t know the basic structure of the C programming click on below link:

Hope that you understand the above code easily. If you find any difficulty to understand above code; ask your queries via below comment section.

You can also read my other tech blog where I write about WordPress and Its elements: Zerootech

Leave a Comment

Show Buttons
Hide Buttons