given an array Arr[] of integer numbers have size N Task is to find out single or consecative numbers from Arr[] with sum 0 when found print "1" otherwise
Answers
Answered by
2
Yes we can find the sum of elements in an array;
example:
#include <stdio.h>
int main()
{
int a[5]={1,2,3,4,5}; // Here N is 5;
int sum = 0, I;
for(I=0;i<5;i++)
{
sum = sum + a[I];
}
printf("Sum of elements in an array is %d\n", sum);
return 0;
}
Similar questions