Write a program to find the sum of series.
i) S= -2+4-6+8-10……..till n.
Answers
Answered by
3
Answer:
Write a c program to find out the sum of series 1 + 2 + …. + n
#include<stdio.h>
int main() {
int n,i;
int sum=0;
printf("Enter the n i.e. max values of series: ");
scanf("%d",&n);
sum = (n * (n + 1)) / 2;
printf("Sum of the series: ");
Similar questions