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.
since variable int is used,so on checking num variable,it should also be checked in integer type variable,so as on dividing we get some decimal value,i.e. ,an error.
****So,check if(num==val*val)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Smart Number
You are viewing a single comment's thread. Return to all comments →
****Solution for java
since variable int is used,so on checking num variable,it should also be checked in integer type variable,so as on dividing we get some decimal value,i.e. ,an error.
****So,check if(num==val*val)