Skip to main content

Posts

Showing posts with the label Day 19: Interfaces Hackerrank Solution in Java

Day 19: Interfaces Hackerrank Solution Java

 Day 19: Interfaces Hackerrank Solution Java For Explanation Check Video: Sample Input 6 Sample Output I implemented: AdvancedArithmetic 12 Code: import  java.io.*; import  java.util.*; interface  AdvancedArithmetic{     int  divisorSum( int  n); } class  Calculator  implements  AdvancedArithmetic {      public   int  divisorSum( int  n) { //6          int  sum =  0 ;          for ( int  i= 1 ;i<=n;i++){              if (n%i== 0 ){                 sum = sum + i;             }         }        ...