0% found this document useful (0 votes)
8 views45 pages

Control Statements

The document explains control statements in Java, which manage the flow of execution in a program through decision-making, looping, and altering the flow based on conditions. It details various types of control statements including decision-making statements, switch statements, looping statements, and jump statements, with a focus on conditional statements like if, if-else, if-else-if ladders, and nested if statements. Additionally, it covers the syntax and examples for using switch statements with different data types.

Uploaded by

bhoomiya1503
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views45 pages

Control Statements

The document explains control statements in Java, which manage the flow of execution in a program through decision-making, looping, and altering the flow based on conditions. It details various types of control statements including decision-making statements, switch statements, looping statements, and jump statements, with a focus on conditional statements like if, if-else, if-else-if ladders, and nested if statements. Additionally, it covers the syntax and examples for using switch statements with different data types.

Uploaded by

bhoomiya1503
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 45

Control Statements

CONTROL STATEMENTS

Control statements:

 Control statements in Java allow you to manage the flow of execution within a program. They enable
decision-making, looping, and altering the flow based on certain conditions.
 The main categories of control statements in Java are:

1.Decision-Making Statements

2.Switch Statements

3.Looping Statements

4.Jump Statements
CONTROL STATEMENTS

Decision Making (or) Conditional Statements:


 In Java, conditional statements are used to make decisions based on conditions. These conditions evaluate to
either true or false, and based on the result, different blocks of code can be executed. There are different types of
conditional statements, and each one can work with various types of values like boolean, int, String, and more.

Types of Conditional Statements in Java:

1.if (or) Simple If (or) Single State if statement


2.if-else (or) Two State if statement
3.if-else-if ladder (or) Cascaded if (or) Multi State if Statement
4.Nested if Statement
5.Ternary operator (? :)

These conditional statements work with different types of values based on the conditions provided.
CONTROL STATEMENTS

1) if Statement:
 The if statement in Java is a basic control structure used to execute a block of code only if a specified condition
evaluates to true. If the condition is false, the block of code inside the if statement is skipped.
 Condition: A boolean expression that returns either true or false. If the condition is true, the code inside the if block is
executed. If it is false, the code is ignored.

Working of if Statement:

1.The program first evaluates the condition inside the if statement.


2.If the condition evaluates to true, the block of code inside the if statement is executed.
3.If the condition evaluates to false, the block of code inside the if statement is skipped.

Key Points:

4.Single block execution: Only the code inside the if block is executed if the condition is true.
2.Condition must evaluate to boolean: The condition in the if statement must be a boolean expression (true or false).
3.Curly braces: Curly braces {} are used to define the block of code that should be executed if the
condition is true. They can be omitted if there is only one statement, but it’s generally a good practice
to always use them to avoid mistakes.
CONTROL STATEMENTS

Syntax:
if (condition)
{
// code to execute if condition is true
}

Example with boolean value:


boolean isRaining = true;
if (isRaining) {
System.out.println("Take an umbrella!");
}

Example with comparison (int type):


int temperature = 30;
if (temperature > 25)
{
System.out.println("It's hot outside.");
}
 In this example, the condition checks if the temperature is greater than 25. If it's true, the message
"It's hot outside" is printed.
CONTROL STATEMENTS

Examples of if Statement with Different Conditions:

1. Checking Equality:

int x = 100;
if (x == 100)
{
System.out.println("x is equal to 100.");
}

 The condition x == 100 checks if the value of x is equal to 100. Since it is, the message "x is equal to 100" is printed.

2. Using if with Logical Operators:

int age = 25;


if (age >= 20 && age <= 30)
{
System.out.println("You are in your 20s.");
}

 The condition age >= 20 && age <= 30 checks if the age is between 20 and 30. Since the age is 25, the condition
evaluates to true and the message "You are in your 20s" is printed.
CONTROL STATEMENTS

2) if-else Statement
 The if-else statement in Java is a control flow structure that allows you to execute one block of code if a condition is
true and another block if the condition is false. It is used to handle two alternative paths of execution based on a
condition.
 Condition: A boolean expression that evaluates to either true or false.
 If the condition is true, the block of code inside the if statement is executed.
 If the condition is false, the block of code inside the else statement is executed.

Working of if-else Statement:

1.The condition in the if statement is evaluated.


2.If the condition is true, the code inside the if block is executed, and the else block is skipped.
3.If the condition is false, the code inside the else block is executed, and the if block is skipped.
CONTROL STATEMENTS

Syntax:
if (condition)
{
// Code to execute if the condition is true
}
else
{
// Code to execute if the condition is false
}

Example with boolean value:


int number = 10;
if (number > 0)
{
System.out.println("The number is positive.");
}
else
{
System.out.println("The number is not positive.");
}
Explanation:
•The condition number > 0 checks if the number is greater than 0.
•Since the condition is true, the program prints "The number is positive."
•If number were less than or equal to 0, the else block would execute, printing "The number is not positive.
CONTROL STATEMENTS

Examples of if Statement with Different Conditions:


int age = 16;
if (age >= 18) {
System.out.println("You are eligible to vote.");
}
else {
System.out.println("You are not eligible to vote.");
}
 In this example, the program checks if age is greater than or equal to 18.
 Since age is 16, the condition is false, so the else block is executed, printing "You are not eligible to vote."

 You can combine conditions using logical operators (&&, ||, etc.) inside an if-else statement.

Example with Logical Operators:


int temperature = 30;
if (temperature >= 25 && temperature <= 35) {
System.out.println("It's a warm day.");
} else {
System.out.println("The weather is not warm.");
}
 The condition temperature >= 25 && temperature <= 35 checks if the temperature is between 25 and 35 degrees
inclusive.
 Since the condition is true, the message "It's a warm day" is printed.
 If the condition were false, the program would print "The weather is not warm."
CONTROL STATEMENTS

3) if-else-if Ladder
 The if-else-if ladder in Java allows you to test multiple conditions sequentially. If one of the conditions is true, its
corresponding block of code is executed, and the rest of the ladder is skipped. If none of the conditions are true, the
else block (if present) is executed.

Key Points:
 Sequential evaluation: The conditions are evaluated one after the other. Once a condition is found to be true, the
corresponding block is executed, and the rest of the ladder is skipped.
 else block is optional: You can omit the else block if you only want to handle specific cases and don't need to
handle the scenario where none of the conditions are true.
 Efficient use: The if-else-if ladder is useful when there are multiple conditions to check, such as determining a
grade, checking age ranges, or comparing values.
CONTROL STATEMENTS

Syntax of if-else-if Ladder:


if (condition1)
{
// Code to execute if condition1 is true
}
else if (condition2)
{
// Code to execute if condition2 is true
}
else if (condition3)
{
// Code to execute if condition3 is true
}
else
{
// Code to execute if none of the above conditions are true
}

How It Works:
•The program first checks condition1. If it is true, the corresponding block of code is executed, and the rest of the else-if
blocks are skipped.
•If condition1 is false, the program checks condition2, and so on.
•If none of the conditions are true, the else block (if present) is executed.
CONTROL STATEMENTS

Example of if-else-if Statement: (Grading System)


int marks = 85;
if (marks >= 90) {
System.out.println("Grade: A");
}
else if (marks >= 80) {
System.out.println("Grade: B");
}
else if (marks >= 70) {
System.out.println("Grade: C");
}
else if (marks >= 60) {
System.out.println("Grade: D");
}
else {
System.out.println("Grade: F");
}
Explanation:
 The program checks multiple conditions:
 If marks are 90 or higher, it prints "Grade: A".
 If marks are between 80 and 89, it prints "Grade: B".
 If none of the conditions are met, the else block runs, printing "Grade: F".
 For marks = 85, the condition marks >= 80 is true, so the program prints "Grade: B" and skips the
rest of the conditions.
CONTROL STATEMENTS

Example of if-else-if Statement: (Checking Age Group)


int age = 25;
if (age < 13)
{
System.out.println("Child");
}
else if (age >= 13 && age < 20)
{
System.out.println("Teenager");
}
else if (age >= 20 && age < 60)
{
System.out.println("Adult");
}
else
{
System.out.println("Senior Citizen");
}

Explanation:
 If age is less than 13, the program prints "Child".
 If age is between 13 and 19, it prints "Teenager".
 If age is between 20 and 59, it prints "Adult".
 Otherwise, the program prints "Senior Citizen".
 For age = 25, the program will print "Adult".
CONTROL STATEMENTS

Example of if-else-if Statement: (Comparing Three Numbers)


int a = 10, b = 20, c = 15;
if (a > b && a > c)
{
System.out.println("a is the largest");
}
else if (b > c)
{
System.out.println("b is the largest");
}
else
{
System.out.println("c is the largest");
}

Explanation:

 The program checks which number is the largest among a, b, and c.


 Since b is the largest, the output is "b is the largest".
CONTROL STATEMENTS

4) Nested if Statement
 The nested if statement in Java is used when there are multiple layers of conditions to evaluate, meaning an if
statement is placed inside another if or else block. This allows you to check multiple conditions in a hierarchical or
layered manner, where one condition depends on another.

How Nested if Works:


 The outer if checks the first condition (condition1).
 If condition1 is true, the inner if is evaluated for condition2.
 The inner block only runs if both condition1 and condition2 are true.
 If condition1 is false, the program skips the inner block and executes the code in the else block (if there is one).

Key Points to Remember:


 Control flow: Nested if statements allow for complex decision-making by checking conditions within conditions.
 Readability: Too many nested if statements can make the code harder to read and understand. Use them wisely to
avoid complexity.
 Indentation: Proper indentation is crucial in nested if statements to make the logic clearer.
 Execution: The inner if statement is only executed if the outer if condition is true.
 Nested if statements are powerful but should be used carefully to avoid overly complex code that becomes hard to
maintain and understand.
CONTROL STATEMENTS

Example of Nested if Statement: (Checking multiple conditions for


eligibility)
int age = 20;
boolean hasID = true;
if (age >= 18)
{
System.out.println("You are old enough to vote.");
if (hasID)
{
System.out.println("You are allowed to vote.");
}
else
{
System.out.println("You need an ID to vote.");
}
}
else
{
System.out.println("You are not old enough to vote.");
}
Explanation:
 The outer if checks if the person is at least 18 years old.
 If the condition is true (age is 20), the inner if checks if the person has an ID.
 If both conditions are true, the message "You are allowed to vote" is printed.
 If hasID is false, the message "You need an ID to vote" is printed.
CONTROL STATEMENTS

Example of Nested if Statement: (Calculating grades based on marks)


int marks = 85;
if (marks >= 50)
{
System.out.println("You passed.");
if (marks >= 90)
{
System.out.println("Grade: A");
}
else if (marks >= 80)
{
System.out.println("Grade: B");
}
else
{
System.out.println("Grade: C");
}
}
else
{
System.out.println("You failed.");
}

Explanation:
 The outer if checks if the student passed with a score of 50 or higher.
 If the student passed, the nested if statements determine the grade based on the score.
 If marks>=90, the grade is A, if marks>=80, the grade is B, and for other passing scores, the grade is C.
 If marks is below 50, the student failed.
CONTROL STATEMENTS

Example of Nested if Statement: (Find max among the given three)


int a = 10;
int b = 20;
int c = 30;
if (a > b)
{
if (a > c) {
System.out.println("a is the largest.");
}
else {
System.out.println("c is the largest.");
}
}
else
{
if (b > c) {
System.out.println("b is the largest.");
}
else {
System.out.println("c is the largest.");
}
}
Explanation:
 The first condition (a > b) is checked in the outer if.
 If a > b, another if inside it checks whether a > c. If true, a is the largest; otherwise, c is the largest.
 If the outer condition is false (a <= b), the else block checks whether b > c. If true, b is the largest;
otherwise, c is the largest.
CONTROL STATEMENTS

Switch Statements:
 The switch statement in Java is used to execute one block of code among many choices, based on the value of an
expression. The switch expression can be of different types (integers, characters, strings, etc.), and the corresponding
case that matches the value of the expression will be executed.

Java switch supports several types of values, including:

Key Points:
 Primitive types: int, char, byte, short, etc., are supported in switch.
 String: You can use String values in switch from Java 7 onward.
 enum: Use enum constants in switch to handle sets of constant values.
 Wrapper classes: Wrapper types like Integer, Character, etc., can be used thanks to auto-unboxing.
 Enhanced switch: From Java 12, switch expressions allow returning values and support a cleaner arrow syntax.

The switch statement provides an efficient way to write readable, structured code, especially when handling multiple
possible values for a variable.
CONTROL STATEMENTS

Basic Syntax of switch Statement:


switch (expression)
{
case value1:
// code to be executed if expression == value1
break;
case value2:
// code to be executed if expression == value2
break;
default:
// code to be executed if no cases match
}

 The expression is evaluated and compared with each case.


 If a match is found, the corresponding block of code is executed.
 The break statement is used to terminate the switch block and avoid the execution of subsequent cases (fall-through
behavior).
 The default block is optional and executes if no case matches.
CONTROL STATEMENTS

switch with int Type


 This is the most common use of the switch statement, where the expression is of type int or an equivalent numeric type
like byte, short, etc.
Example:
int day = 3;
switch (day)
{
case 1:
System.out.println("Monday");
break;
case 2:
System.out.println("Tuesday");
break;
case 3:
System.out.println("Wednesday");
break;
default:
System.out.println("Invalid day");
}

Explanation:
 In this example, the day variable holds the value 3, so the code in the block for case 3 will execute,
printing "Wednesday".
 If no match is found (e.g., day = 7), the default block is executed.
CONTROL STATEMENTS

switch with char Type


 You can also use switch with char values. The char type holds single characters enclosed in single quotes.
Example:
char grade = 'B';
switch (grade)
{
case 'A':
System.out.println("Excellent!");
break;
case 'B':
System.out.println("Good!");
break;
case 'C':
System.out.println("Average");
break;
default:
System.out.println("Invalid grade");
}

Explanation:
•Here, the char variable grade is checked against the different cases. Since grade is 'B', the program prints "Good!".
•If the value doesn’t match any of the cases, the default block executes.
CONTROL STATEMENTS

switch with String Type (Introduced in Java 7)


 From Java 7 onward, the switch statement can work with String types. This allows switching on string values rather than
just primitive types.
Example:
String fruit = "Apple";
switch (fruit)
{
case "Apple":
System.out.println("Apples are red or green.");
break;
case "Banana":
System.out.println("Bananas are yellow.");
break;
case "Orange":
System.out.println("Oranges are orange.");
break;
default:
System.out.println("Unknown fruit.");
}

Explanation:
 In this case, the switch expression is a String variable. If fruit is "Apple", the program prints
"Apples are red or green."
 Using switch with String types is useful when there are multiple string options and you want to avoid
repeated if-else comparisons.
CONTROL STATEMENTS

switch with enum Type


 enum (enumeration) is a special Java type used to define collections of constants. switch can operate on enum types,
making it easier to work with constant values.
Example:
enum Day { SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY }
public class Main {
public static void main(String[] args) {
Day day = Day.WEDNESDAY;
switch (day) {
case MONDAY:
System.out.println("It's Monday!");
break;
case WEDNESDAY:
System.out.println("It's Wednesday!");
break;
case FRIDAY:
System.out.println("It's Friday!");
break;
default:
System.out.println("It's some other day.");
}
}
}
Explanation:
 Here, we define an enum called Day with constant values representing days of the week.
 The switch compares the day variable against the constants and prints "It's Wednesday!" when the
value is Day.WEDNESDAY.
CONTROL STATEMENTS

switch with Wrapper Classes


 switch in Java also works with wrapper classes that correspond to primitive types, such as Integer, Character, etc.,
because of Java’s auto-unboxing feature.

Example:
Integer number = 10;
switch (number)
{
case 5:
System.out.println("Number is 5.");
break;
case 10:
System.out.println("Number is 10.");
break;
default:
System.out.println("Unknown number.");
}

Explanation:
 In this example, number is an Integer object. Due to auto-unboxing, the switch statement automatically converts it into
its primitive int type, allowing it to be used in the switch expression.
CONTROL STATEMENTS

Enhanced switch Expressions (Java 12 and Above)


 Starting from Java 12, the switch statement was enhanced to be used as an expression, which allows returning values.
Additionally, Java introduced arrow (->) syntax for cleaner code.

Syntax:

switch (expression)
{
case value1 -> statement1;
case value2 -> statement2;
default -> statement3;
}
CONTROL STATEMENTS

Example:
int day = 3;
String dayName = switch (day)
{
case 1 -> "Monday";
case 2 -> "Tuesday";
case 3 -> "Wednesday";
case 4 -> "Thursday";
case 5 -> "Friday";
case 6 -> "Saturday";
case 7 -> "Sunday";
default -> "Invalid day";
};
System.out.println(dayName);

Explanation:
 The new syntax allows switch to return a value (e.g., dayName), making the code more concise and readable.
 Instead of break, the -> operator is used, and there is no fall-through behavior in this new form.
 The expression is evaluated, and the result is directly assigned to dayName.
CONTROL STATEMENTS

switch with var Type (Java 10 and Above)


 Starting from Java 10, the var keyword can be used for local variable type inference. While this doesn’t change the
behavior of switch, it can make the code more concise.
Example:
var day = 2; // Inferred as int
switch (day)
{
case 1:
System.out.println("Monday");
break;
case 2:
System.out.println("Tuesday");
break;
default:
System.out.println("Unknown day");
}

Explanation:
 The var keyword allows Java to infer the type of day based on the assigned value (int in this case).
 The switch statement works exactly the same way as it does with explicit type declarations.
CONTROL STATEMENTS

Ternary Operator (?:)


 The ternary operator is a shorthand for an if-else statement. It is used to evaluate a boolean condition and return one of
two values based on the result.
Syntax:
result = (condition) ? value1 : value2;

Explanation:

int num = 10;


String result = (num % 2 == 0) ? "Even" : "Odd";
System.out.println(result);
Example:

int num = 10;


String result = (num % 2 == 0) ? "Even" : "Odd";
System.out.println(result);
In this example, num % 2 == 0 is true, so the result is "Even".
CONTROL STATEMENTS
Conditional
Use Case Explanation
Statement
Used when you need to Executes code inside the if block if the
if statement execute a block of code only if condition evaluates to true. Otherwise, skips
a particular condition is true. the block.
Used when you need to
Executes code inside the if block if the
execute one block of code if a
if-else statement condition is true, or the else block if the
condition is true, and another
condition is false.
if it is false.
Used when you need to check
Checks conditions sequentially. The first true
multiple conditions and
if-else-if ladder condition's block is executed, and the rest are
execute different blocks of
skipped.
code for different cases.

Used when a variable or


expression can take multiple Evaluates the expression and executes the
switch statement discrete values and you want to matching case block. A default block can be
execute different code for each used for unmatched cases.
value.
A shorthand for if-else when
Ternary operator Returns one of two values depending on
you want to assign a value
(? :) whether the condition is true or false.
based on a condition.
CONTROL STATEMENTS

Looping Statements:

In Java, loops allow repetitive execution of a block of code while a condition is true. The three
primary looping constructs in Java are:

 for loop: Used when the number of iterations is known beforehand.

 while loop: Used when the condition must be checked before execution.

 do-while loop: Used when the block must execute at least once, as the condition is
checked after execution.
CONTROL STATEMENTS

1. for Loop
A for loop is useful for iterating over a sequence or a range of values.
Syntax:
for (initialization; condition; update) {
// code to be executed
}
Example:
public class ForLoopExample
{
public static void main(String[] args) {
// Print numbers from 1 to 5
for (int i = 1; i <= 5; i++) {
System.out.println("Number: " + i);
}
}
}
Explanation:
•Initialization (int i = 1): Variable i is initialized to 1.
•Condition (i <= 5): The loop executes as long as i is less than or equal to 5.
•Update (i++): i is incremented by 1 after each iteration
CONTROL STATEMENTS

2. while Loop
The while loop is used when the number of iterations is not predetermined.
Syntax:
while (condition) {
// code to be executed
}
Example:
public class WhileLoopExample {
public static void main(String[] args) {
int i = 1;
while (i <= 5)
{
System.out.println("Number: " + i);
i++; // Increment the counter
}
}
}
Explanation:
 The condition (i <= 5) is checked before entering the loop.
 The loop runs until i exceeds 5.
CONTROL STATEMENTS

3. do-while Loop
The do-while loop guarantees that the block is executed at least once.
Syntax:
do {
// code to be executed
} while (condition);
Example:
public class DoWhileLoopExample {
public static void main(String[] args) {
int i = 1;
// Print numbers from 1 to 5
do {
System.out.println("Number: " + i);
i++; // Increment the counter
} while (i <= 5);
}
}
Explanation:
•The block is executed once before the condition (i <= 5) is checked.
CONTROL STATEMENTS

Nested Loops
Loops can also be nested for more complex scenarios.
Example: Printing a multiplication table
public class NestedLoopExample {
public static void main(String[] args) {
for (int i = 1; i <= 5; i++) { // Outer loop
for (int j = 1; j <= 5; j++) { // Inner loop
System.out.print(i * j + "\t");
}
System.out.println();
}
}
}
Output:
1 2 3 4 5
2 4 6 8 10
3 6 9 12 15
4 8 12 16 20
5 10 15 20 25
CONTROL STATEMENTS

Key Points to Remember


1.Break: Use break to exit the loop prematurely.
2.Continue: Use continue to skip the rest of the current iteration.
3.Infinite Loops: Be cautious of infinite loops, e.g., while (true) without a break.

Example of break and continue:


public class BreakContinueExample {
public static void main(String[] args) {
for (int i = 1; i <= 10; i++) {
if (i == 5) {
continue; // Skip printing 5
}
if (i == 8) {
break; // Exit loop when i is 8
}
System.out.println("Number: " + i);
}
}
}
CONTROL STATEMENTS
Summary Table

Loop Type Key Use Case Condition Check

for Known number of iterations Before loop

Unknown iterations, condition


while Before loop
before loop

Unknown iterations, execute


do-while After loop
block at least once
CONTROL STATEMENTS

Practice Questions:
Java CON I0 I.Equal Or NOT EQUAL
Java CON I0 2:ODD OR EVEN
Java CON I0 3.Divisible
Java CON I0 4 : pass or fail
Java CON I0 5.find min
Java CON I0 6.Find max
Java CON I0 7.POS Or Neg or Zero
Java CON I0 8 Divisible By 3,5
Java CON I0 9.X and Y axis Problem
Java CON I0 10.Vowels or Consonants
CONTROL STATEMENTS

Practice Questions:
java CON L1 1 Leap Year
java CON.L1.2 Day, of, week
java CON.L1 3.Month Name
java CON L1 4.Uppercase or Lowercase
java CON L1 6 Gross Salary
java CON L1 5.Alphabet or Number or special Character
java CON.L1 7.calculate grade
java CON.L1 8 Arithmetic Operations
java CON L1.9 Electricity BILL
java CON.L1 10.triangle or not
CONTROL STATEMENTS

Practice Questions:
Java CON L2 Equilateral or Isosceles or Scalene
Java CON L2 Triangle Validation
Java CON L2 Find min of 3 numbers
Java CON L2 Find maximum of 3 number
Java CON L2 Find the largest of 4 numbers
Java CON L2 3 in Ascending order
Java CON L2 Arrange 4 numbers in descending order
Java CON L2 Time is valid or not
Java CON L2 DATE_VALID
CONTROL STATEMENTS

Practice Questions:
JAVA_LOOP L0_1.EVEN Numbers
JAVA_LOOP L0_2.Sum of First N odd number
JAVA_LOOP L0_3.Sum of even numbers
JAVA_LOOP L0_4.Sum divisible by 3 or 5 in range
JAVA_LOOP L0_5.FACTORIAL
JAVA_LOOP L0_6.Power Problem
JAVA LOOP L0_7.Multiplication
JAVA_LOOP L0_8.max,min,sum and average of the given n numbers
CONTROL STATEMENTS

Practice Questions:
JAVA_LOOP_LI_1Perfect Square
JAVA_LOOP_LI_2.perfect cube
JAVA_LOOP_LI_3.To make a perfect square
JAVA_LOOP_LI_4.powfunction
JAVA_LOOP_L1_5.Quotient
JAVA_LOOP_LI_6.Multiplication
JAVA_LOOP_LI_7.TRIANGULAR NUMBER
JAVA_LOOP_LI_8.Alphabet
JAVA_LOOP_LI_9.fibonacci series
JAVA_LOOP_L1_10.Skip iteration
CONTROL STATEMENTS

Practice Questions:
JAVA_LOOP_L2_1.Trailing Zeros
JAVA_LOOP_L2_2.alt_2_3_power
JAVA_LOOP_12_3.mul_div_by_2_series
JAVA_LOOP_L2_4.Pentagonal number
JAVA_LOOP_L2_5.Proth number
JAVA_LOOP_L2_6.Co-ordinate from origin
JAVA_LOOP_L2_7.Remaining Days
JAVA_LOOP_L2_8.Completed Days
JAVA_LOOP_L2_9.Elapsed Time
JAVA_LOOP_L2_10.DATE DIFFERENCE
THANK YOU

You might also like