the following is my code im not getting the correct output can anyone say what is wrong with my code?
#include<stdio.h>
#include<stdlib.h>
int printArrayElementsSum(int *a,int n){
int sum=0;
for(int i=0;i<n;i++){
sum+=a[i];
}
printf("%d",sum);
}
int main(){
int N;
scanf("%d",&N);
int arr[N],index;
for(index=0;index<N;index++){
scanf("%d",&arr[index]);
}
printArrayElementsSum(arr,N);
return 0;
}

intfromprintArrayElementsSumand you also have signed integer overflow which means that yourintcan't handle numbers that big. - I also agree with @alex01011. It's very hard to copy/paste the figures you've used in your question when you have them as pictures.