Skip to content

Instantly share code, notes, and snippets.

@hrshadhin
Created April 23, 2013 16:49
Show Gist options
  • Select an option

  • Save hrshadhin/5445325 to your computer and use it in GitHub Desktop.

Select an option

Save hrshadhin/5445325 to your computer and use it in GitHub Desktop.
Add numbers from two different arrays
#include<stdio.h>
void TAsum(int nam1, int nam2);//fuction prototype
int main()
{
int i;
int a1[]={2,3,4,5,6};
int a2[] = {9,8,7,5,2};
for(i=0;i<5;i++)
{
TAsum(a1[i],a2[i]);//call the function
}
return 0;
}
void TAsum(int nam1, int nam2)
{
printf("%d",nam1+nam2);//show the result of addition of 2 differents arrays value
printf("\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment