Thursday, April 3, 2014

PROGRAM TO ADD TWO EQUAL SIZED ARRAY

//PROGRAM TO ADD TWO EQUAL SIZED ARRAY

#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],b[10],c[10],i,m;
clrscr();
printf("enter the limit for array\n");
scanf("%d",&m);
printf("enter the elements of array1 and array2\n");
for(i=0;i<m;i++)
{
scanf("%d",&a[i]);
scanf("%d",&b[i]);
c[i]=a[i]+b[i];
}
printf("the elements of third array are\n");
for(i=0;i<m;i++)
printf("%d\n",c[i]);
getch();
}

No comments:

Post a Comment