06-04-2011, 08:05 PM
There are many way to initialize the array. Don't use the default initialization of array
we can initialize the array using a loop to assigning some value initialize the array explicitly
Suppose :
i// arrays example
#include <iostream>
using namespace 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;
0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
