Tutorial 2 Java Fundamentals
Tutorial 2 Java Fundamentals
b.
string chapter = 'Summary';
System.out.println(chapter);
c.
int num;
++num++;
num1 = num;
d.
int num = 3000;
System.out.printf("%4.2f\n", num);
e.
String contact;
Scanner keyboard = new Scanner(System.out);
contact = keyboard.nextLine();
6. Write a java program that print the circumference of a circle. The input of the
program is diameter. Display the result in three decimal places. (Note = Math.PI)
7. Write a java program that converts inches to meters. (Given 1 inch equals to 2.54
centimeters). Print the output in two decimal places.