guys i need help ASAP since i need to submit this miniproject and i need 1 more minor questions need asnwered.
the C++ coding is given below, i need to change it to function type but giving out the same output.
#include <iostream>
#define SIZE 7
using namespace std;
int main()
{
int A[ SIZE ] = { 2, 4, 8, 16, 32, 64, 128};
int i, j;
int total = 0;
cout <<"Value of array: ";
for ( j = 0; j <SIZE; j++)
cout<< A[j] <<" ";
cout<<endl;
for ( i = 0; i < SIZE; i++ )
{
total += A[i];
}
cout << "Total of 2 power n from 2 to 128 are: "<<total;
return 0;
}
thanks in advance if anyonemanaged to answer it within 45 minutes from now.