Skip to main content
3 of 3
added 11 characters in body
Gareth
  • 11.4k
  • 1
  • 36
  • 85

C

void main()
{
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
     {
     if(i>0)
     sum=sum+i;
     }
printf("sum of positive numbers is %d",sum);
}