Error while calculating sum of n terms of a exponential series to n terms:
Following is my program for calculating the sum of exponential series upto n terms:
e = 1/0! + 1/1! + 1/2! + 1/3! + 1/4! + 1/5!+....1/n!
While executing the code in dev-C++, the program stops executing and goes into an infinite loop after entering 'n'. Kindly help.
printf("enter the number of terms");
scanf("the number of terms are %d",&n);
printf("the sum is %f",sum);