Computer Science, asked by uditagarwal86, 1 year ago

4. Write a function fact(int n) to find the factorial of a number n. Include a main class to
find the value of S where:
n!
SE
m!(n - m)! i want the answer in java language​

Answers

Answered by sanjaysharma1982sd81
0

Answer:

fjvjdhchufg ego is h thinking yogurt their chal rest the on the serious

Answered by yogeshparashar452
0

Explanation:

#include<iostream.h>

#include<conio.h>

void fact(int n, int &facto)

{

int i;

for(i=1;i<n;i++)

       facto*=i;

}

void main()

{

clrscr();

int n,m,fn,fm,a,fa,s;

fn=fm=fa=1;

cout<<"Enter a number : ";

cin>>n;

cout<<"Enter a number : ";

cin>>m;

fact(n,fn);

fact(m,fm);

a=n-m;

fact(a,fa);

s=fn/(fm*fa);

cout<<" Factorial of "<<n<<" = "<<fn<<'\n';

cout<<" Factorial of "<<m<<" = "<<fm<<'\n';

cout<<" Factorial of "<<a<<" = "<<fa<<'\n';

cout<<" s = "<<s<<'\n';

getch();

}

please mark brainliest

Similar questions