/* * ex7.c */ #include int main() { int n, i; float data, max; printf("Enter a positive integer: "); scanf("%d", &n); if(n < 1) { printf("Wrong count: %d\n",n); return 0; } printf("Enter %d data:\n",n); scanf("%f", &max); for(i=2; i<=n; ++i){ scanf("%f", &data); if(max < data) max = data; } printf("The largest data is: %f\n", max); return 0; } // largest among n data ex7.c