100 Days of Java challenges
Day 4 - Basic Arithmetic Operations
1. Write a program that declares two integer variables and perform basic arithmetic operations (addition, subtraction, multiplication, division) on them. Print the results to the console.
2. Write a program that calculates the area of a rectangle. Prompt the user to input the length(integer) and width(integer) of the rectangle, calculate the area (length * width), and print the result.
3. Modify the above program to read decimal numbers as the length and width, and output the area to two decimal points
Reading List:
1. Learn about formatting options such as precision, alignment, and decimal places to present output in a clear and concise manner
2. Write a program that calculates the area of a rectangle. Prompt the user to input the length(integer) and width(integer) of the rectangle, calculate the area (length * width), and print the result.
3. Modify the above program to read decimal numbers as the length and width, and output the area to two decimal points
Reading List:
1. Learn about formatting options such as precision, alignment, and decimal places to present output in a clear and concise manner
Community|Blog|Youtube Hunt|Logic Puzzles|Careers|Contact Us
Have Feedback or want to contribute? Email: hello[@]100DaysOfCode.io
100DaysOfCode@2024