Thursday, May 2, 2013

Summation of 1 to n Numbers of Numbers

Summation of 1 to n Numbers of Numbers

#include<stdio.h>
void main()
{
int i,sum=0,num;
printf("Enter the Number: ");
scanf("%d",&num);
for(i=1; i<=num; i++)
sum=sum+i;
printf("The Summation is: %d",sum);
}

summation in C++, C++ Program, Programming

No comments:

Post a Comment