Online Java Compiler By
JavaTpoint.com
public class CosExample1 { public static void main(String[] args) { double a = 60; // converting values to radians double b = Math.toRadians(a); System.out.println(Math.cos(b)); } }
Output