#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(void){
char
kata_1[20], kata_2[20], kata_3[20];//Array 1 dimensi
strcpy(kata_1,"dwi");strcpy(kata_2,"yanto");//copy
data dimasukkan ke kata_1&2
printf("NAMA
ASLI : \n");
printf("KATA
1 = %s \n",kata_1);//manggil dwi dlm
variable kata_1 dgn %s
printf("KATA
2 = %s \n",kata_2);//manggil yanto dlm
variable kata_2 dgn %s
printf("==============");
printf("\n
\n");//enter2x
//memindahkan
dwi ke kata_3;kata_1 kosong &diisi yanto;kata_2 kosong diisi dwi
strcpy(kata_3,kata_1);strcpy(kata_1,kata_2);strcpy(kata_2,kata_3);
printf("CANGE
: \n");
printf("KATA
1 = %s \n",kata_1);//yang dipanggil
kata_1 yg sdh berisi yanto
printf("KATA
2 = %s \n",kata_2);//yang dipanggil
kata_2 yg sdh berisi dwi
printf("==============");
system("pause");
}
No comments:
Post a Comment