summation of array call by reference

#include<stdio.h>

int sum(int a[])
{int x=0;
int i;
for(i=0;i<10;i++)
    {x+=a[i];}   
    x+=4;
   
return x;   
}

int main()
{
    int i,a[30];
    int ans;
    for(i=0;i<10;i++)
    a[i]=i;
   
    ans=sum(a);
    printf("%d\n",ans);
   
return 0;   
}

Popular posts from this blog

เทคนิค ชนะ เกมเศรษฐี 14 ตารวด!!! ( Let's get Rich )

Using Google Chrome Inspect Element to Analyze the website

Easy way to download whole youtube play list and convert them to mp3