Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

check if number is odd java

if (num % 2 == 0)
{
	// even number
}
else
{
	// odd number
}
Comment

odd number in java

import java.util.Scanner;

public class Exam{
	public static void main(String[] args){
    
		Scanner scan = new Scanner(System.in);
        System.out.println("Enter number");
		int input = scan.nextInt();
		if(input % 2 != 0){
        	System.out.println(input + " is odd");
	      }
		else
			System.out.println(input + " is even");
	}
}	
Comment

odd numbers in Java

n = 10;
for (int i=0; i<=10; i++){
  System.out.println(2*n+1);
}
Comment

PREVIOUS NEXT
Code Example
Java :: Duplicate class com.google.android.gms.internal.firebase_messaging.zzo found in modules jetified-firebase-iid 
Java :: hashtable 
Java :: install java 11 
Java :: Build path specifies execution environment JavaSE-1.8. There are no JREs installed in the workspace that are strictly compatible with this environment. 
Java :: java length of array 
Java :: java break statement 
Java :: unicode in java 
Java :: java character in string 
Java :: java listview 
Java :: top easiest languages programming to learn 
Java :: java resto 
Java :: how to draw a circle in java swing 
Java :: lombok 
Java :: extract substring in string java 
Java :: taglib in jsp 
Java :: java 8 stream add to list 
Java :: java gerüst 
Java :: how to get history stack in android webview 
Sql :: safe update mysql 
Sql :: all workbenches in minecraft 
Sql :: select all fields in soql 
Sql :: sql server get utc date 
Sql :: mysql alter table add index 
Sql :: mariadb select multiple rows into one column 
Sql :: mysql unix timestamp to date 
Sql :: remove accented characters from string sql 
Sql :: sqlite rename column 
Sql :: base64 encode sql server 
Sql :: delete database mysql 
Sql :: sql getdate date only 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =