by Dinesh Thakur Category: Array
#include <stdio.h>

#include <conio.h>
int main()
{
    int array1 [10], i, number , j, flag=0;
    clrscr ();
    printf("\n Enter the size of the array:");
    scanf ("%d", &number);
    for(i=0;i<number;i++)
       {
           scanf("%d", &array1[i]);
       }
    for(i=0;i<number;i++)
       {
          for(j= i+1;j<number;j++)
             {
                if(array1[i] == array1[j] && i!=j)
                  {
                       flag=1;
                       printf("\n Duplicate number %d found at location %d and %d", array1 [i],i, j);
                  }
            }
      }
       if (flag==60)
          {
               printf ("\n No Duplicate");
          }
          return 0;
}

array of integers contain a duplicate number



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles