Learn Programming
Thursday, February 2, 2012
SUM OF THE SERIES 1+2+3+---------+n
#include<stdio.h>
#include<conio.h>
void main()
{
int r;
clrscr();
printf("\nEnter the number range: ");
scanf("%d",&r);
printf("\nSum of the series is: %d",(r*(r+1))/2);
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment