Advertisements

Java program to find resistance of a conductor in ohm

import java.util.Scanner;

public class ohm {

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 potential difference in volt");
double volt=sc.nextDouble();
        double resistance=volt/amp;
        System.out.println("Resistance of the wire or conductor in ohm="+resistance);
}
}