how should i make this program who compares on negative number
Max value of array
Using simple greater than operator will do the job or using max function.
m being the largest till now, a, being current value.
if(a>m)
m=a; // a can be anything positive negative zero
or
m=max(a,m);
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
Hello why have you made the array of size 100 only if the n is greater than 100 what will you do ??
And this is wrong pls see why are you comparing the index with the max element, you don’t need to compare the index you need to compare the array value.
for (int i=0;i<n;i++){
if (a[i>maximum]){
maximum=a[i];
}
}
You have written this. But instead of comparing a[i > maximum] you need to do a[i] > maximum
And for size you can declare the array of size around 1000000.
So that whatever be the n your array can accomodate that index and most probably the value of n is within 1000000.
I hope it is clear to you. In case it is clear to you pls mark it as resolve and provide the rating as well as feedback so that we can improve ourselves.
In case there is still some confusion pls let me know, I will surely try to help you out.
Thanks 
Happy Coding !!
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.