Friday, April 14, 2023

Coding Challenge #51 Factorial (Loop)

 // finds factorial of a number
function fac(x){
    var done = x;
    while(x > 1) done *= --x;
    return done;
}

No comments:

Post a Comment

Coding Challenge #54 C++ int to std::string (no stringstream or to_string())

Gets a string from an integer (ejemplo gratis: 123 -> "123") Wanted to come up with my own function for this like 10 years ago ...