// arrays example
#include <iostream>
usingnamespace std;
int billy [] = {16, 2, 77, 40, 12071};
int n, result=0;
int main ()
{
for ( n=0 ; n<5 ; n++ )
{
result += billy[n];
}
cout << result;
return 0;
}
n- is a stepper variable
result is a most recent holder or sumator variable
billy is an intiger array and it holds variables as written
in main result gets numbers from array and stores it
billy [0] = 16
so result at that step is : result =0+16
at next step billy [1] = 2
so result after that is previous result =16 +2
next step where billy [2] = 77
so result = 18+77
and so on