+ 5
int myArray[] = {2, 4, 6, 8, 10}; int len = sizeof(myArray)/sizeof(*myArray); for(int i=0; i<len; i++) { myArray[i] *= 2; cout << myArray[i] << " "; } // That's one way to do it.
26th Dec 2017, 2:31 PM
Dev
Dev - avatar