Java program for natural logarithm

Java program for base e

Java program for logarithm function

Program:-

import java.util.Scanner;

class group{
public static void main(String angt[]){
Scanner data = new Scanner(System.in);
double num,num1;
System.out.println("Enter a number");
num1=data.nextDouble();

num=Math.log(num1);
System.out.println("log Answer:"+num);


}
}


Output:-

Enter a number
3
log Answer:1.0986122886681098





Learn Java:-
Java codes

Java Programs:-
List of Java Programs

One Comment

Add your comments here

Back to Top