#include<stdio.h>
#include<math.h>
int fact(int i) {
if (i==0)
{
return 1;
}
return i*fact(i - 1);
}
int main() {
int sum,i,x;
do
{
printf("enter a number\n");
sum = 0;
scanf("%d", &x);
for (i = 1; i <11; i++)
{
sum += pow(x, i) / fact(i);
}
sum += 1;
} while (printf("%d\n", sum));
system("PAUSE");
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.