Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

Comment



Working with switch case



Test expression



Header file



Specifer




Array_find duplicate number in a array




// AHF C PROGRAM SOLVING

//solving here 2_D   ARRAY 	programming problem

#include<stdio.h> #include<math.h> #define pf printf int main() { int i,arr[20],j,n; pf("Enter size of array: "); scanf("%d",&n); pf("\nEnter the elements of the array: "); for(i=0;i< n;i++) scanf("%d",&arr[i]); //here is checking the duplicate number pf("\nDuplicate elements are: "); for(i=0; i < n; i++) { for(j=i+1;j < n;j++) { if(arr[i]==arr[j]) pf("%d\t",arr[i]); } } return 0; }
OUTPUT:


© 2018 - All rights reserved