Google interview question

Test cases of the function I wrote

Interview Answer

Anonymous

11 Dec 2015

#include int main() { int a[10]={2,4,1,5} , b[10]={3,4,1,9},c[10]; int i=0,j=0,k=1; for(i=0;i<4;i++) { for(j=0;j<4;j++) { if(a[i]==b[j]) { while(k) { c[k]=a[i]; printf("elements are %d ",c[k]); k++; break; } } } } }