Skip to main content
added 11 characters in body
Source Link
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);
}
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);
}

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);
}

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); }

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);
}

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); }

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);
}
Source Link

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); }