factor NUMBER
Example:
$ factor 815
815: 5 163
I think he meant more along the lines of the product of the numbers that add up to the number from 1.
So like this:
10! = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1
Unfortunately, I have not been able to find any command that does factorials. The 'bc' command would have been the perfect choice because of its abilities to calculate extremely high values like 2^1000. How ever since you know how factorials work (multiplication), you can actually just make one for yourself.
The commands:
let, bc, expr, [], etc are helpful for mathematical expressions in bash
Chat with our AI personalities
#include #include using std::cin;using std::cout;using std::endl;using std::tolower;long factorial(const int& N);int main(){int N = 0; //factorial of Nchar command = 'n';do{cout > N;cout
i need a pic of cuson
Factorials are the product of 1 and all the integers up to the given number. Simply put, 5 factorial or 5! = 5*4*3*2*1
chutia mc,bc bhosdika
/*program to find the factorial of a given number*/ #include<stdio.h> #include<conio.h> int fact(int); void main() { int n,c; printf("\n enter the number for which you want to find the factorial"); scanf("%d",&n); c=fact(n); printf("\n the factorial of the number %d is %d",n,fact); getch(); } int fact(int n) { int k; if(n==0) return(1); else k=n*fact(n-1); return(k); }