JSFiddle - React, Tailwind, and code Playground

by Alexandru Mihai

JavaScript

function multi(x, y){
	var p = 0;
  do{
  	x/=2;
    y = y * 2;
    console.log(y);
    if(x%2 == 1)
    	p+= y;
  }while(x > 0);
  console.log(p);
  return p;
}

console.log(multi(13,25));