Skip to main content

Posts

Showing posts with the label R and calculate Simple Interest.

ads1

11. Write a C program to enter P, T, R and calculate Simple Interest.

  11. Write a C program to enter P, T, R and calculate Simple Interest. Solution :- #include<stdio.h> #include<conio.h> void main() {     clrscr();     float principle,rate,time,simple;     printf("Enter the Principle amount :-\n");     scanf("%f",&principle);     printf("Enter the Rate of Intereset :-\n");     scanf("%f",&rate);     printf("Enter the Time period :-\n");     scanf("%f",&time);     simple = principle * rate*time/100;     printf("The Simple Interest is :-%f\n",simple); getch(); } Output :- 

JAVA PROGRAM || Write a JAVA program to enter P, T, R and calculate Simple Interest.

                                                 JAVA PROGRAM Write a Java program to enter P, T, R and calculate Simple Interest.   (Hint) Simple Intereset = P*R*T/100   Static  class SimpleInterest {     public static void main(String args[])     {         double p=25000.50,r=8.5,t=5;         double sp = p * r * t/100;         System.out.println("The simple interset is :- "+sp);     } }   Output :-     Dynamic :-  import java.util.*; class SimpleInterest {     public static void main(String args[])     {           Scanner in = new Scanner(System.in);      System.out.println("Enter the Principle amount :-");     double principle = in.nextDouble();     System.out.println("Enter the Rate of interest :-");     double rate = in.nextDouble();     System.out.println("Enter the Time period  :-");     double time = in.nextDouble();     double sp = principle * rate * time/100;     System.out.println("The simple interset is :- "+sp);     } } Out

ads2