1.
#includedouble fact(int n);int main(void){ int i; double sum; sum=0; for(i=1;i<=100;i++) sum=sum+fact(i); printf("1!+2!+...+100!=%e\n",sum); return 0;}double fact(int n){ int i; double result; result=1; for(i=1;i<=n;i++) result=result*i; return result;}
2.
#include<stdio.h>
float fact(int n);int main(void){ int m,n; float num1,result; printf("Enter m:"); scanf("%d",&m); printf("Enter n:"); scanf("%d",&n); num1=fact(m-n); result=fact(n)/(fact(m)*num1);printf("result=%.0f\n",result);
return 0;}float fact(int n){ int i; float result; result=1; for(i=1;i<=n;i++){ result=result*i; } return result;}