View Code of Problem 30

#include <stdio.h>
int main()
{
  int n,t,sum;
  scanf("%d",&n);
  sum=0;
  for(t=1;t<=n;++t)
  {
    sum=sum+t;
  }
  printf("%d",sum);
  return 0;
}

Double click to view unformatted code.


Back to problem 30