Friday, February 26, 2021

 

3.WAP IN JAVA TO INPUT THREE NUMBERS AND COUNT HOW MANY OF THEM ARE EVEN .

 

import java.util.*;

class Prog

{

 public static void main(String args[ ])

 {

   Scanner ob=new Scanner(System.in);

  int x,y,z;

System.out.print(“Enter the numbers”);

x=ob.nextInt();

y=ob.nextInt();

z=ob.nextInt();

int count=0;

if((x%2)==0)

count+;

if((y%2)==0)

count+;

if((z%2)==0)

count+;

System.out.println(“Total Even numbers”+count);

}

}

 

No comments:

Post a Comment

  3.WAP IN JAVA TO INPUT THREE NUMBERS AND COUNT HOW MANY OF THEM ARE EVEN .   import java.util.*; class Prog {   public static ...