Computer Science, asked by manojkumaryadav870, 8 months ago

A special two digit number is such that when the sum of its digits is added to the product of its digits, the result is equal to the original two digit number. Write a program to accept a two digit number. Add the sum of its digits to the product of its digits. If the value is equal to the number input, display the message "Special number " otherwise ,display the message "Not a special number ".

Answers

Answered by kingcobra1
29

Answer:

public class special

{

public static void main(int a)

{

int b=a%10;

int c=a/10;

int d=b+c;

int e=b*c;

int f=d+e;

if(f==a)

{

System.out.print("special number");

}

else

{

System.out.println("Not a special number");

}

}

}

Answered by adityakumarsin63
1

Answer:

import java.util.*;

class TwoDigitNumber

{

public static void main(String args[])

{

Attachments:
Similar questions