Computer Science, asked by binilagireesh33, 1 year ago

C program to print the dupicate elements in the array​

Answers

Answered by asamreddy
1

Explanation:

#include<stdio.h>

#include<conio.h>

void main()

{

int i,arr[20],j,no;

clrscr();

printf("Enter size of array: ");

scanf("%d",&no);

printf("Enter any %d elements in array: ",no);

for(i=0;i<no;i++)

{

scanf("%d",&arr[i]);

}

printf("Duplicate elements are: ");

for(i=0; i<no; i++)

{

for(j=i+1;j<no;j++)

{

if(arr[i]==arr[j])

{

printf("%d\n",arr[i]);

}

}

}

getch();

}

Similar questions