Pages

Thursday, January 23, 2025

Calculate Simple Interest in C language

 #include<stdio.h>


int main() {

    int principal, t, rate;

    

    printf("Enter the Principal Rate: ");

    scanf("%d", &principal);

    

    printf("Enter the Time in years: ");

    scanf("%d", &t);

    

    printf("Enter the Rate: ");

    scanf("%d", &rate);

    

    int SI = (principal*t*rate)/100;

    printf("The Simple Interest is: %d", SI);

    

    


return 0;


}

CODED and Tested

No comments:

Post a Comment

3Sum - Leetcode solution - How i turned into two-pointer approach?

  class Solution {     public List < List < Integer >> threeSum ( int [] nums ) {         Arrays . sort (nums); // first sort...