In general it can be used to execute one block of statement among two blocks, in java language if and else are the keyword in java.
Syntax : If(Condition){
Statement(s)
}else{
Statement(s)
}
...........
In the above syntax whenever condition is true all the if block statement are executed, remaining statement of the program by neglecting. If the condition is false else block statement executed and neglecting if block statements.
Program:
import java.util.Scanner; class Oddeven { public static void main(String[] args) { int no; Scanner s=new Scanner(System.in); System.out.println("Enter any number :"); no=s.nextInt(); if(no%2==0) { System.out.println("Even number"); } else { System.out.println("Odd number"); } } }Output:
Enter any number : 10 Even number- Progamming is what actually means ?
- What is software development ?
- How we categorized software development in different manner.
C Programming
C Plus Plus
Python
Java Development
Web Designing
Javascript
Mysql
Oracle
C Plus Plus
Python
Java Development
Web Designing
Javascript
Mysql
Oracle
We cover all the programming concepts in various programming languages, this tutorials are very help full for bigener as well as Experience developer, for the ease of understanding we categorized programming in different manner likewise.