#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;
}
}
#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
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 #