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