if - then condition
public class Main { Public static void main(String[] args) { if (boolean expression T or F) { //body } else { // do this } } }
Else If
loops
for loop
/* Syntax of for loop for ( initialization; condition; increment /decrement){ //body } */
While Loops
/* Syntax: while (condition) { //body } */
When to use which loop
use while loop when we don’t know how many time loop run and use for loop when we know how many time does loop run
do while loop
do {
} while (condition);
do while loop executes atleast ones and after that it will check condition
Q1 Check if the char is at lowercase or uppercase
Q2. Fibonacci no.
Q3 count repeated numbers
Q4. reverse a number
