int main()
{
int array[] = {3,4,7,8,9,10,21,3};
int count = 0; int sum = 0;
for(int i=2;i<5;i++)
{
cout = count+1;
sum = sum+array[i];
}
cout<<cout;
cout<<sum;
Looks fine, apart from the typo on the first line inside the for loop.
You've made the same typo on the first cout statement.
I'd advise that you tidy it up a little (make sure the indentation is correct, maybe use variables for the interval range), but it should work fine provided the above typos are fixed.