Pengabungan 2 larik array data acak
#include <stdio.h>
int main()
{
int arr1[5] = {1,2,3,4,5};
int arr2[3] = {6,7,8};
int arr3[8];
int i;
for(i=0;i<5;i++)
{
arr3[i] = arr1[i];
}
for(i=5;i<8;i++)
{
arr3[i] = arr2[i-5];
}
for(i=0;i<8;i++)
{
printf("%d",arr3[i]);
}
return 0;
}
Komentar
Posting Komentar