fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int arr[7]={2,6,8,7,9,5,7};
  5. int check=0;
  6. for(int i=0;i<7;i++){
  7. for(int j=i+1;j<7;j++){
  8. if(arr[i]==arr[j]){
  9. check=1;
  10. break;
  11. }
  12. }
  13. }
  14. if(check==0) printf("There is no duplicate of any element");
  15. else printf("There is duplicate ");
  16.  
  17.  
  18.  
  19.  
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 5288KB
stdin
Standard input is empty
stdout
There is duplicate