Last active
September 25, 2017 10:42
-
-
Save RianWardana/c3bf614b18bbf6c44b603dabcd920132 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Nurian S Wardana | |
// Modify array | |
#include <stdio.h> | |
void gantiIsiArray(int array[], int arrayLength) { | |
int n; | |
for(n = 0; n < arrayLength; n++) { | |
array[n] = array[n] * 2; | |
} | |
for(n = 0; n < arrayLength; n++) { | |
printf("%d ", array[n]); | |
} | |
} | |
int main() { | |
int numbers[] = {1,2,3,4,5,6}; | |
int numbersLength = sizeof(numbers) / sizeof(int); | |
gantiIsiArray(numbers, numbersLength); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment