View Code of Problem 30

#include <stdio.h>
#include <stdlib.h>
#include<math.h>


int main()
{

     int n,s;
     while(scanf("%d",&n)!=EOF)
     {

         s=n*(n+1)/2;
         printf("%d\n",s);
     }
    return 0;
}

Double click to view unformatted code.


Back to problem 30