Write a C program to find Sum of series S=1+(1+2)+(1+2+3)+..….+(1+2+3+…+n).This program calculates the sum of series upto n i.e user input and produce result.
In this C Program, Firstly we are going to take input integer ‘n’ from the user and then starts loops starting from 1 to n and calculate sum for each iteration.After that just print the result i.e sum as output on the screen.
Here, the C program to find Sum of series S=1+(1+2)+(1+2+3)+..….+(1+2+3+…+n) is successfully compiled and run on the windows system and produces the output as shown below for different input i.e n. Let’s check out this C Program shown below : :
SOURCE CODE : :
OUTPUT : :
Above is the source code for C program to find Sum of series S=1+(1+2)+(1+2+3)+..….+(1+2+3+…+n) which is successfully compiled and run on Windows System.The Output of the program is shown above .
need an explanation for this answer? contact us directly to get an explanation for this answer