Computer Science, asked by friendsforever7244, 8 months ago

please Dear Friends
Please Help Me It's Urgent​

Attachments:

Answers

Answered by Vyomsingh
5

Answer:

class evenodd

{

void main(int n)

{

int even=0,odd=0;

for(;n>0;n=n/10)

{

int k=n%10;

if(k%2==0)

even++;

else

odd++;

}

System.out.println("EVEN DIGITS:-"+even+"\n ODD DIGITS:-"+odd);

}

}

_____________________________________

PLEASE MARK ME AS BRAINLIST ❤️❤️

Answered by anindyaadhikari13
40

class Program

{

static void main(int n)

{

int a=0,b=0;

while(n!=0)

{

int d=n%10;

if(d%2==0)

a++;

else

b++;

n/=10;

}

System.out.println("Even digits: "+a) ;

System.out.println(" Odd Digits: "+b) ;

}

}

Please mark me brainliest.

Similar questions