fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. float a[10];
  5. int f = 0;
  6.  
  7. printf("Enter 10 float values:\n");
  8. for (int i = 0; i < 10; i++)
  9. scanf("%f", &a[i]);
  10. for (int i = 0; i < 9 && !f; i++)
  11. {for (int j = i + 1; j < 10; j++) {
  12. if (a[i] == a[j])
  13. f = 1;
  14. }
  15. }
  16.  
  17. printf("Duplicates: %s\n", f ? "Yes" : "No");
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 5276KB
stdin
1
2
3
4
5
6
7
8
9
0
stdout
Enter 10 float values:
Duplicates: No