Datasheet

.
#include <stdio.h>
int main()
{
int nterms, term = 0, i;
printf("How many terms? "); /* Ask the user for input */
scanf("%d", &nterms); /* Read the whole number */
for(i=1;i<=nterms;i++) /* Loop over the terms in the series */
{
term += i; /* Sum the counter to produce each term */
printf("%d ",term); /* Print this term */
}
printf("\n"); /* Print a new line character before the program exits */
return 0;
}
unsigned int factorial(unsigned int x); /* Declare function */
unsigned int factorial(unsigned int x)
{
/* 0! is one. */
unsigned int result = 1; /* Declare an variable to hold the return value */
while(x>0) /* Loop while x is greater than zero */
{
result *= x; /* multiply x by result and assign to result */
x--; /* Decrement x by one */
}
return result; /* Return x! when x is not zero. */
}
x