Advertisements

Java program to find potential difference in volts

import java.util.Scanner;

public class potentialdifference {

public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the current in ampere");
double amp=sc.nextDouble();
System.out.println("Enter the resistance in ohm");
double ohm=sc.nextDouble();
double volt=amp*ohm;
System.out.println("The potential difference in volt is="+volt);

}
}