Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int num[15], may, men, i;
- float prom=0;
- for (i=0; i<15; i++) {
- printf("%d.- Introduce un numero: ", i+1);
- scanf("%d", &num[i]);
- prom=prom+num[i];
- if (i==0) {
- may=num[i];
- men=num[i]; }
- else
- if (num[i] > may)
- may=num[i];
- if (num[i] < men)
- men=num[i]; }
- printf("El numero mayor es %d.\n", may);
- printf("El numero menor es %d.\n", men);
- printf("El promedio es %.2f.", prom/15.0);
- }
Advertisement
Add Comment
Please, Sign In to add comment