Skip to content

Lab exercises of java

Mohamed Hassan (JOHN) edited this page Jan 30, 2025 · 4 revisions

6874



Write a Java program to print the sum of 74 and 36.

Expected Output: 110


Write a Java program to divide 50 by 3 and print them on the screen.

Expected Output: 16


Write a Java program that displays the product of 25 by 5.

Expected Output: 125


Write a Java program to print the area and perimeter of a rectangle where Width = 5.5 and Height = 8.5

Area of rectangle = length Γ— width

Perimeter of a rectangle = 2 (Length + Width)

Expected Output:

Area is 5.6 * 8.5 = 47.60

Perimeter is 2 * (5.6 + 8.5) = 28.20

Clone this wiki locally