Answers for "this shows that how to take string and use it as a number"

0

this shows that how to take string and use it as a number

public class DivBy9 {
    public static boolean check(String ns) {
  var sum = 0;
  for(var i = 0; i < ns.length(); i++){
    sum += Integer.parseInt(ns.charAt(i) + "");
  }
  return (sum%9) == 0;
    }
}
Posted by: Guest on June-14-2021

Code answers related to "this shows that how to take string and use it as a number"

Browse Popular Code Answers by Language