We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Before manipulation of number,
I added another condition becasue of following statment
: In case any of the values are ≤0, print "java.lang.NumberFormatException: All the values must be positive" without quotes and terminate the program.
Main reason that your code didn't work properly is the position of declaration which is Scanner.
Final output value also should check whether the value is bigger than zero or not.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Detect the Email Addresses
You are viewing a single comment's thread. Return to all comments →
Before manipulation of number, I added another condition becasue of following statment : In case any of the values are ≤0, print "java.lang.NumberFormatException: All the values must be positive" without quotes and terminate the program.
Main reason that your code didn't work properly is the position of declaration which is Scanner.
Final output value also should check whether the value is bigger than zero or not.