Category: Series

C Programming Code on Series,Leap year,LCM

*** To Solve 1+2+3+…….+n write C prog code using different Loop. USING FOR LOOP——— #include main() { int n,k,sum=0; printf(“Enter your number “); scanf(“%d”,&n); for(k=1;k<=n;k=k+1) { sum=sum+k; } printf(“The result is %d”,sum); } *** To Solve 1+2+3+…….+100 write C prog code using different Loop. #include main() { int k=1,sum=0; for(k=1;k<=100;k=k+1) { sum=sum+k; } printf(“the result…