google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a program to find sum of two arrays in c - 2nd puc computer science

Write a program to find sum of two arrays in c

Write a program to find sum of two arrays in c

#include<stdio.h>

#include<conio.h>

void main()

{

int a[10],b[10],sum[10],i,n;

clrscr();

printf("How many elements?");

scanf("%d",&n);

printf("Enter the elements for first array\n");

for(i=0;i<n;i++)

scanf("%d",&a[i]);

printf("Enter the elements for second array\n");

for(i=0;i<n;i++)

scanf("%d",&b[i]);

printf("Sum of array\n");

for(i=0;i<n;i++)

sum[i]=a[i]+b[i];

for(i=0;i<n;i++)

printf("%d\n",sum[i]);

getch();

}

Write a program to find sum of two arrays in c Write a program to find sum of two arrays in c Reviewed by Vision Academy on December 26, 2021 Rating: 5

No comments:

CheckOut

Powered by Blogger.