diff --git a/src/controlStatements/IfCondition.java b/src/controlStatements/IfCondition.java new file mode 100644 index 0000000..4974ed7 --- /dev/null +++ b/src/controlStatements/IfCondition.java @@ -0,0 +1,14 @@ +package controlStatements; + +public class IfCondition { + + public static void main(String[] args) { + int person_age=25; + if(person_age>=18) // always boolean expression + { + System.out.println("Person is eligible for Voting"); + } + + } + +} diff --git a/src/controlStatements/IfElseCondition1.java b/src/controlStatements/IfElseCondition1.java new file mode 100644 index 0000000..b77e122 --- /dev/null +++ b/src/controlStatements/IfElseCondition1.java @@ -0,0 +1,19 @@ +package controlStatements; + +public class IfElseCondition1 { + + public static void main(String[] args) { + + int a=10; + + if(a%2==0) + { + System.out.println("Even number"); + } + else + { + System.out.println("Odd number"); + } + } + +} diff --git a/src/controlStatements/IfElseCondtion.java b/src/controlStatements/IfElseCondtion.java new file mode 100644 index 0000000..0e1743a --- /dev/null +++ b/src/controlStatements/IfElseCondtion.java @@ -0,0 +1,19 @@ +package controlStatements; + +public class IfElseCondtion { + + public static void main(String[] args) { + int person_age=17; + if(person_age>=18) // always boolean expression + + { + System.out.println("Person is eligible for Voting"); + } + else + { + System.out.println("Person is not eligible for Voting"); + } + + } + +}