Hello There, for this WSQ we need the use of a accumulator which multiplies it self and the value can add him self is not much. That’s it and have a nice week. The Source Code flickr photo by Daniel Hoherd https://www.flickr.com/photos/warzauwynn/2794764081/ Some Rights Reserved
For this task i had to make a program that calculates the factorial of a given number, and of course to create a function. The code i wrote is this: https://github.com/sabaldaba/TC101/blob/master/Wsq09-Factorial The program at the end also gives you the… Continue Reading →
https://github.com/estebanpinal/WSQ/blob/master/WSQ09
I had a very har time with this exercise, since at the time I had no idea of how to use loops, later I began to understand how stuff works and stopped getting stuck in things like this, though I still preffer to do things without recursión, because it makes finding mistakes easyer for me.
You should follow the leader… and multiply yourself times them. Factorials are one of the most fascinating parts of math, but I for one couldn’t wrap my head around how to do a code for this one. Credit to my partner Samantha Rivera for showing me an easy way to do it through recursion. I’ll … Continue reading WSQ09 →
Ken helped me a lot to do this when he explained us in class and with his video… Also with a video on Youtube: https://www.youtube.com/watch?v=6cTP_ls_DLY Here is my code: https://github.com/Andreandc/TC1017/blob/master/WSQ09
// Factorial Calculator #include <iostream> using namespace std; int fact (int q, int e, int w) { q = 0; w = 1; cout << “Dame un número positivo ” <<endl; cin >> e; while (q<e) { w = w*(q+1); q = q+1;} cout <<“El factorial de ” << e << ” es “; return […]
Made a factorial calculator using a loop. Here’s the code: And here’s the test run:
So this is simple factorial calculator, it was kind of easy to do. This is factorialcalc.py in action!