View Code of Problem 30

#include <stdio.h>
int main()
{
	int i;
	int n = 0;
		while(scanf("%d",&i)!=EOF){
    for(int p= 1;p<=i;p++)
	{
    n = n+p;			
    }
    	printf("%d\n",n);
    	n = 0; 
}
	return 0;
 } 

Double click to view unformatted code.


Back to problem 30