Computer Science, asked by sonprodigal, 1 month ago

import java.util.Scanner;

public class KboatEvenSuccessor
{
public void computeProduct() {
Scanner in = new Scanner(System.in);
System.out.print("Enter the number: ");
int num = in.nextInt();
int orgNum = num;
int prod = 1;

while (num != 0) {
int digit = num % 10;
num /= 10;

if (digit % 2 == 0)
prod = prod * (digit + 1);
}

if (prod == 1)
System.out.println("No even digits in " + orgNum);
else
System.out.println("Product of even digits successors is "
+ prod);
}
}

What is the question of this programming?​

Attachments:

Answers

Answered by LemmieLove
1

 \blue{  \Large{\boxed{ \tt{ \red{Answer : }}}}}

{

public void computeProduct() {

Scanner in = new Scanner(System.in);

System.out.print("Enter the number: ");

int num = in.nextInt();

int orgNum = num;

int prod = 1;

while (num != 0) {

int digit = num % 10;

num /= 10;

if (digit % 2 == 0)

prod = prod * (digit + 1);

}

Answered by anitadevi052704
4

Answer:

yo yo good morning

told you no need but thanks for your thanks XD

Similar questions