" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
Verified answer
Ans:Compile code di bawah.
---------------------------------
#include <iostream>
using namespace std;
void printarray (int arg[], int length) {
for (int n=0; n<length; ++n)
cout << arg[n] << ' '; cout << '\n';
}
int main ()
{
int firstarray[] = {1, 1, 1, 1, 1};
int secondarray[] = {1, 0, 0, 0, 1};
int thirdarray[] = {1, 0, 0, 0, 1};
int fourtharray[] = {1, 0, 0, 0, 1};
int fiftharray[] = {1, 1, 1, 1, 1};
printarray (firstarray,5);
printarray (secondarray,5);
printarray (thirdarray, 5);
printarray (fourtharray, 5);
printarray (fiftharray, 5);
}
---------------------------------
File .cpp dan .txt terlampir dan bisa di download.
Output ketika di jalankan: