Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language programming: input two integer arrays, each array has 10 different elements, and output the elements appearing in the two arrays.
C language programming: input two integer arrays, each array has 10 different elements, and output the elements appearing in the two arrays.
# include & ltstdio.h & gt

void main(){

int a[ 10];

int b[ 10];

int a 1,a2;

Printf ("Please enter 1 0 integers of the array1");

printf(" \ n ");

for(int I = 0; I< 10; i++){

scanf("%d ",& ampa 1);

a[I]= a 1;

}

Printf ("Please enter 10 integer of the second array");

printf(" \ n ");

for(I = 0; I< 10; i++){

scanf("%d ",& ampa2);

b[I]= a2;

}

for(I = 0; I< 10; i++){

for(int j = 0; j & lt 10; j++){

if(a[i]==b[j])

printf("%d ",a[I]);

}

}

}