Advertisement
Istanvir389

common elements

Sep 13th, 2017
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3.  
  4. {
  5. int arr[1000];
  6. int i,n;
  7. printf("Enter number ");
  8. scanf("%d",&n);
  9. for(i=0;i<n;i++)
  10. {
  11. scanf("%d",&arr[i]);
  12. }
  13. for(i=0;i<n;i++)
  14. {
  15. if(arr[i]==arr[i+1])
  16.  
  17. continue ;
  18. printf("%d",arr[i]);
  19.  
  20. }
  21.  
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement