Factorial2

Page 1

#include<conio.h> #include<stdio.h> #include<windows.h> main() { int n,i,j, facto; float x,x1; clrscr(); printf("programa serie\n"); printf("ingrese el valor de n\n"); scanf("%d",&n);x=0; for(i=1;i<=n;i++) { facto=1; for(j=1;j<=i;j++) { facto=facto*j; } x1=i/facto; x=x+x1; } printf("el factorial de %d\n",n,facto); system("pause"); }


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.