google.com, pub-8786015629279405, DIRECT, f08c47fec0942fa0 WAP to Calculate Simple Interest in Java.

WAP to Calculate Simple Interest in Java.

1


//Write a Program to calculate Simple Interest in Java.

import java.io.*;


class sum

{
public static void main(String args[])

{

int p,r,t,si;

p=100;

r=10;

t=10;

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

System.out.print(“The Simple Interest is  =”+si);

}

}

Output:


The Simple Interest is  =100

//Write a Program to calculate Simple Interest in Java Using Scanner Class

import java.io.*;
import java.util.*;

class sum
{
public static void main(String args[])
{
int p,r,t,si;
Scanner obj=new Scanner(System.in);
System.out.println(“Enter the Value of Principle \n”);
p=obj.nextInt();
System.out.println(“Enter the Value of Rate of Interest  \n”);
r=obj.nextInt();
System.out.println(“Enter the Value of Time \n”);
t=obj.nextInt();
si= (p*r*t)/100;
System.out.println(“\n The Simple Interest is  =”+si);
}
}
Output:

The Simple Interest is  =100

Post a Comment

1 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Thank you for your interest 😊

We will back shortly after reviewing...

Thank you for your interest 😊

We will back shortly after reviewing...

Post a Comment

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
To Top