answersLogoWhite

0


Best Answer

import java.util.*;

class even{

public static void main(String[]args){

Scanner cons = new Scanner(System.in);

int even;

even = cons.nextInt();

if(even % 2 == 0)

{

System.out.println(even);

}

}

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Java code that display even numbers from 0 to 10?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What Program that will display the even numbers in data structures and algorithms?

JAVA


Can the processor of a computer system directly execute source programs written in Java?

No. Even using the Java Native Interface, code written in Java is always in a high-level language.


Why cant someone hack a Java program if they know the Java programming language?

Knowing Java does not allow you to hack a Java program because the source code is not available to hackers. Also, a program interprets the bit-code before you see it, so even with a decompiler, hacking the program will not be possible.


Java program to find sum on even numbers from 12-45?

sum = 0; for (int i = 12; i


Draw a flowchart to accept 3 numbers and display the largest number?

draw a flowchart to display the first tenth even number


Why we can't create a os using java?

Sure, We can design OS using java, c++ and even with C also but the main reason is the code will be very hectic and very lengthy tooo


What is JAVA drive by?

AnswerA Java Drive-By is a Java Applet that is coded in Java and is put on a website. Once you click "Run" on the pop-up, it will download a program off the internet. This program can be a virus or even a simple downloader. If you'd like to get the source code or wanna know more information about a Java Drive-By, use Google.


What is a Java Drive By?

AnswerA Java Drive-By is a Java Applet that is coded in Java and is put on a website. Once you click "Run" on the pop-up, it will download a program off the internet. This program can be a virus or even a simple downloader. If you'd like to get the source code or wanna know more information about a Java Drive-By, use Google.


What is a Java Drive-By?

AnswerA Java Drive-By is a Java Applet that is coded in Java and is put on a website. Once you click "Run" on the pop-up, it will download a program off the internet. This program can be a virus or even a simple downloader. If you'd like to get the source code or wanna know more information about a Java Drive-By, use Google.


Write a java program to find sum of even and odd numbers in given array?

for(int i = 1; i < 100; i+=2) { System.out.println(i); }


Is there a sample program for constructor?

All Java programs would have a constructor... public class Test { public Test(){ ... } ..... } This is a constructor. Even if you dont code the constructor Java would automatically place a default constructor for compilation.


What is the input and output to a Java interpreter?

The input is source code (MyClass.java) and the output is bytecode (MyClass.class).Generally, Java compilers receive as input .java source code files, and output .class binary files which are then executed by the Java Virtual Machine (JVM) executable.Some Java compilers output binaries in machine code that can be directly executed.The input is a source file with the java extension. (i.e. HelloWorld.java) The output is the byte code file with the class extension. (i.e. HelloWorld.class)Input:1. Most compilers take as input the source program which is in a particular programming language.2. Compilation Switches ( special arguments that tell the nature of compilation and structure of target code).3. Supporting Files (Library Files) such files help in the execution and translation of a programOutput:1. Program List file.2. Target Code. Target code is the equivalent of the source code but in another language