// counts distinct values in array // wdg 2008 #include int main(void) { const int COUNT = 100; int A[COUNT]; // for testing purposes fill strangely int i; int curr=1; for(i=0; i max ) { second = max; max = A[i]; } else if( A[i] > second ) { second = A[i]; } } // for testing purposes only // should be COUNT-1 if COUNT+1 is a prime printf("Second highest is %d\n", second); return 0; }