summation using c Archives - SeekNLearn.in

Calculating Factorial and Summation upto a number using C program

Calculating Factorial using c language //WAP to calculate factorial of a number #include<stdio.h> void main() { int n,s=1,i=1; printf(“Enter a number to calculate upto”); scanf(“%d”,&n); while(i<=n) { s=s*i; i++; } printf(“Factorial of %d is %d”,n,s); } Calculating Summation using c language #include<stdio.h> void main() { int n,i,s=0; printf(“calculate summation upto”); Read more…