AlgoUniversity
  • Go Back
Discussion
Product And Sum :

Author

Akshay Sharma

Difficulty Level : Medium

Submissions : 82

Asked In : Hexaware

Marks :100

: 0 | : 0

You are given a number N. If N is odd then print the value of the product of digits of the number N otherwise print the value of sum of digits of the number N.

Input

The input contains an integer i.e N ($$$1 \le N \le 10^8$$$).

Output

If N is odd print the value of the product of digits of the number N otherwise print the value of the sum of digits of the number .

Examples

Input
111
Output
1
Input
1234
Output
10

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.