#include<stdio.h> void main() { int sum=0,i,n; printf("\n>>> C Program to print Sum of Series 1+2+3+..+n <<<\n"); printf("\n Enter the number of terms:"); scanf("%d",&n); for(i=1;i<=n;i++) { sum+=i; } printf("\n Sum of series upto %d is :%d \n\n",n,sum); }..
Output:
For C# program: C# Program To Print Sum Of Series 1+2+3+..+n