Explore the topics covered in the Flow controls: Conditions lesson and enhance your programming skills by completing the included programming exercises.

Practice exercises

1

Basic calculator using if

Java basic calculator. Input numbers and operators (+, -, x, /) for calculation. If the symbol is not valid, it displays 'Character not recognized'.

2

ABS - Absolute value

Calculate and display the absolute value of a number in Java with this programming exercise on conditions.

3

Basic calculator using switch

Basic calculator with switch for mathematical operations. Allows decimal numbers and error handling. Practice your skills in Java.

4

Positive and negative

Learn Java: Detect whether a number is positive or negative in this programming exercise. Enhance your Java skills.

5

Check vowels with switch

Create a Java program that prompts the user for a letter (x) and checks whether it is a vowel or any other symbol.

6

boolean and conditional operator

Create a Java program that uses the conditional operator to assign value to a boolean variable.

7

The largest of three numbers

Java exercise to find the largest number among three and practice Java conditions.

8

Conditional operator

9

Nested conditional operator

Create a Java program that prompts the user to enter two integers (a, b) and determines how many of them are positive using nested conditional operators in Java.

10

Switch, break, and default

Calculate a student's grade using a switch statement in Java based on an integer input. Practice using switch, break, and default.

Java Course Lessons

Discover all the lessons included in the Java programming course. Complete all the exercises and learn to program by programming.

Social networks

Help us to share free knowledge and programming in the world.

Keep learning

C# Programming Course

Free programming course with practical exercises and solutions in C#. Start learning right now!

Exercises C# App

Take your Exercises C# lessons everywhere with our Android app. Download it now from Google Play