sum of N integers

#include >
using namespace std;
int main(){
int a[4] = {1, 2, 3, 4};
int sum = 0;
for(int i = 0; i <= 3; i++){
sum += a[i];
cout<<" sum is "<<sum<<endl;

}

}

You just had few syntax errors, take a look at this

#include

using namespace std;

int main()

{

int a[4] = {1, 2, 3, 4};

int sum = 0; 

for(int i = 0; i <= 3; i++)

    { 

        sum += a[i];

    }

cout<<" sum is "<<sum<<endl;

}

You missed #

in first line error.remove just ’ > ’

change it.

#include < iostream >

//