#16 Types of Control Flow Statement in Java | Conditional, Looping & Transfer Statement in Java
package com.sudhirtheindian2.java123;
import java.util.Scanner;
public class types_of_conditional_flow_statement {
public static void main(String[] args) {
// Types of control flow statement
// and how to use if statement in java
// control flow statement
// 1 conditional statement
// 2 looping statement
// 3 transfer statement
// conditional statements types
// 1 if statement
// 2 if else statement
// 3 else if statement
// 4 nested if statement
// 5 switch case statement
// 1 if statement
// it is used when we want to test a single condition
// syntax
// if(condition)
// {
// statement
// }
// program for if statement
System.out.println("enter the password");
Scanner scanner = new Scanner(System.in);
int password= scanner.nextInt();
if(password==1000){
System.out.println("opened my mobile");
System.out.println("my location is USA");
}
}
}
टिप्पणियाँ
एक टिप्पणी भेजें