Java program to convert radians to degrees

Java program to convert radians to degrees using math class 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.toDegrees(num1);
System.out.println("Answer:"+num);

}
}


Output:-

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

}
}



Learn Java:-
Java codes

Java Programs:-
List of Java Programs

Leave reply

Add your comments here

Back to Top