Snippets Collections
// if you want to know a distance between the number and divisor of other number
int n,m;
n = 3, m = 17;
int mod = 17 % 3;     //3 is a divisor of 15 and distance between 15 and 18 is 2 
cout<<mod;            // 2
function lenOfNum(num) {
  num = Math.abs(num)
  if(num < 10 && num >= 0){
    return 1
  }
  let len = 0
  while(num > 1){
    num = num / 10
    len++
    }
  return len
}
double[] a = new double[n];
for (int i = 0; i <n; i++){
  a[i] = Math.random();
}
star

Tue Sep 06 2022 16:54:56 GMT+0000 (UTC)

#c++ #number #number_theory #modulo
star

Fri Sep 02 2022 13:04:44 GMT+0000 (UTC) https://www.geeksforgeeks.org/modulo-operator-in-c-cpp-with-examples/

#c++ #number #number_theory #modulo
star

Tue Jun 07 2022 14:26:35 GMT+0000 (UTC)

#javascript #length #number
star

Wed Jan 26 2022 23:53:43 GMT+0000 (UTC)

#random #number

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension