C Program to find simple interest

Description

Get Principle amount, number of months, rate of interest from user and caluculate simple interest.
Sample Input 1:
5000
12
1.0
Output 2:
600.00

Solution

#include<stdio.h>


int main()


{
    
	
	int p,n;

	double r,si;

    
	scanf("%d %d %lf",&p,&n,&r);


	si=(p*n*r)/100;

	printf("%.2lf",si);

    
	return 0;


}

Explanation

Get principal p, number of months n and rate of intereset r as inputs.(using scanf statement)

calculate Simple Intereset SI by formula SI= p*n*r/100

print Simple Interest SI using printf statement.



Interesting Pattern Programs: for more Patterns

Input:
5
Output:
*
**
***
****
*****
****
***
**
*Solution
Input:
5
Output:
    *
   ***
  *****
 *******
*********
 *******
  *****
   ***
    *Solution
Input:
5
Output:
*        *
**      **
***    ***
****  ****
**********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********
**** ****
***   ***
**     **
*       *Solution
Input:
5
Output:
*********
 *******
  *****
   ***
    *
   ***
  *****
 *******
*********Solution