14. Find even number between two number.
package com.company;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// write your code here
Scanner sc = new Scanner(System.in);
int fist , second , evenN;
System.out.println("To find even number between two number ");
System.out.print("First number : ");
fist= sc.nextInt();
System.out.print("Second number : ");
second= sc.nextInt();
for (int i=1; i<=second;i++)
{
if (i%2==0)
{
System.out.print(i+" ");
}
}
}
}
To find even number between two number
First number : 13
Second number : 65
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64
Process finished with exit code 0
Comments
Post a Comment