#include<iostream>
usingnamespace std;
int main(){
int N,icount,sum_odd,sum_even,max_half,min_half,odd_avrg;
cout<<"Enter how many number followed by the set of integers : "<<endl;
cin>>N;
int inp[N];
max_half = 0;
min_half = (N)*999;
sum_odd = 0;
sum_even = 0;
icount = 0;
for(int i=0; i<N; i++)
cout<<" Enter input number "<<i+0<<" : "<<endl;
cin>>inp[N];
for (int i=0; i<N; i++)
{
if(i<= (N/2))
{
max_half = max(max_half , inp[i]);
}
if (i>(N/2))
{
min_half = min(min_half,inp[i]);
}
if((inp[i]%2)==0)
{
sum_even = sum_even + inp[i];
}
if((inp[i]%2)!=0)
{
sum_odd = sum_odd + inp[i];
icount++;
}
cout<<"The maximum of the first half is:"<<max_half<<endl;
cout<<"The minimum of the second half is:"<<min_half<<endl;
cout<<"The sum of all even numbers is:"<<sum_even<<endl;
cout<<"The average of all odd numbers is:"<<odd_avrg<<endl;
return 0;
}
can anybody help me i try to build and run this program but it dosen't work
If you started using a sensible indentation style, it would help you see more quickly where you might have errors in your braces and with the flow of control.