Java program to convert degrees to radians

Java program to convert degrees to radians using math method

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.toRadians(num1);
System.out.println("Answer:"+num);

}
}

Output:-

Enter a number
30
Answer:0.5235987755982988




Learn Java:-
Java codes

Java Programs:-
List of Java Programs

Leave reply

Add your comments here

Back to Top