Java IF Else Else If

Java If Else And Else If Statements In Hindi

Java

Java If Else And Else If Statements In Hindiif-else Else If statement Yani Control Statements Ko Diya Gya Expression True Hota Hai To Tab if Wala Statement Execute Hota or Agar Expression Else If Wala True Hota Hai to Tab Else If Wala Statement Execute Hota Hai or Agar Expression False Hota Hai Tab Else Wala Statement Execute Nhi Hota Hai |

Also Read -:

Java If Else And Else If In Hindi

Waise To Har Programming Language Main Control Statement Ka Istemal hota Hain Usi Tarah Java Main Bhi Control Statement Ka Istemal Hota |

If Else And Else If Statement Ko Ham Jab Istemal Karte Hain Jaha Par Hame Koi Condition Ko Check Karna Hota Hain |

Read Also : Full Course C programming in Hindi

Java IF Statements In Hindi

Jab Hamare Duvara Diya Gaya Test Expression Agar True Hota Hai To If Statement Execute Hota Hain |

If Statement Ko Ham Jab Istemal Karte Hain Jaha Par Hame Koi Condition Ko Check Karna Hota Hain |

Jab Hamare Duvara Diya Gaya Test Expression Agar True Hota Hai To If Statement Execute Hota Hain |

Syntax:

if( condtion )
{
	//statements;
}

Example:

public class Myclass {
  public static void main(String[] args) {
 
    int x = 10;
    int y = 9;
    
    if(x>y){
      System.out.println("X Value Is Greater");
    }
  }
}

Output:

X Value Is Greater

Is Program Main Aap Dekh Sakte Hain Ki Hamne x = 10 Assign Ki Hain Hamne Ek Condition Ko Lagaya Hain Ki if(x >y) Hain, Aap Is Condition Main Dekh Sakte Hain Ki X Value Greater Hain Isliye Condition True Hogi.

Java If Else Statement In Hindi

If Else control statements ko Diya Gaya expression true Hota Hai Tab if Statements Wala statement Execute Hota hai or agar expression false Hota hai tab Else Wala statement execute Nhi Hota hai.

Program Main Condition Ke Hisab Se Statements Ko Control Karne Ke Liye Control Statements ka Istemal Kiya Jata Hain | Lekin Java Main Koi Types Ki Control Statement Hoti Hain |

Block Diagram :

python if else hindi

If Else Statement Ko Ham Jab Istemal Karte Hain Jaha Par Hame Koi Condition Ko Check Karna Hota Hain |

Jab Hamare Duvara Diya Gaya Test Expression Agar True Hota Hai To If Statement Execute Hota Hain Or Agar Test Expression False Hota Hain Tab Else Wala Statement Execute Nhi Hota Hain |

Syntax:

if (condition) {
  // block of code to be executed if the condition is true
} else {
  // block of code to be executed if the condition is false
}

Example:

public class Myclass {
  public static void main(String[] args) {
 
    int a = 10;
    int b = 20;
 	 if (a > b) {
    	System.out.println("A Value Is Greater");
  	} else {
    	System.out.println("B Value Is Greater");
    }
  }
}

Aap Upper DIye Gaye Program Ko Dekh Sakte Hain Or Jab If Condition True Hoti Hain If Wala Part Execute Hota Hain Or Jab If Condition False Hoti Hain To Else Wala Part Execute Hota Hain |

Output:

B Value Is Greater

Is Program Main Aap Dekh Sakte Hain Ki Hamne a = 10 And b = 20 Assign Ki Hain Hamne Ek Condition Ko Lagaya Hain Ki if(a > b) Hain, Aap Is Condition Main Dekh Sakte Hain Ki b Value Greater Hain Isliye Condition False Hogi |

Java Else If Statement In Hindi

Else If statement Yani Control Statements Ko Diya Gya Expression True Hota Hai To Tab if Wala Statement Execute Hota or Agar Expression Else If Wala True Hota Hai to Tab Else If Wala Statement Execute Hota Hai or Agar Expression False Hota Hai Tab Else Wala Statement Execute Nhi Hota Hai |

Syntax

if (condition)
    statement;
else if (condition)
    statement;
.
.
else
    statement;

Example:

// Java program to illustrate if-else-if ladder 
class ifelseifDemo 
{ 
	public static void main(String args[]) 
	{ 
		int i = 20; 

		if (i == 10) 
			System.out.println("i is 10"); 
		else if (i == 15) 
			System.out.println("i is 15"); 
		else if (i == 20) 
			System.out.println("i is 20"); 
		else
			System.out.println("i is not present"); 
	} 
} 

Output:

i is 20

Yadi Aapne  HTML Full Course  And CSS Full Course And Python Full Course And PHP Full Course Nhi Read Kiya Hai To Aap Vah Bhi Read Kar Sakte Hai |

Friends Mujhe Umeed Hai Ki Aapko IF Else Else IF Statements In Java in Hindi Ke Bare Mai 100% Jankari Ho Gayi Hogi | Agar Aapko Learn Karne Main Dikkat Aa Rahi Hai To Aap Mere Se Contact Kar Sakte Hai |

Leave a Reply

Your email address will not be published. Required fields are marked *