Last active
September 18, 2017 10:18
-
-
Save RianWardana/314e678fbe19f458c02a576be1d3fd3d 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 | |
// Menampilkan isi array | |
#include <stdio.h> | |
int main() { | |
// deklarasi array | |
char array[] = {'a','b','c','d','e','f','g','h','i','j',}; | |
// supaya bisa hitung panjang array | |
int arrayLength = sizeof(array) / sizeof(char); | |
// variabel untuk menghitung loop | |
int n; | |
// mengulang print untuk semua anggota array | |
for(n = 0; n < arrayLength; n++) { | |
printf("%c", array[n]); | |
if (n < arrayLength-1) printf(", "); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment