/** * Output: num is 3.14 */public class MainClass { public static void main(String args[]) throws Exception { System.out.printf("num is %.2f\n", Math.PI ); }}