Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
A_141121_mayorMenor
//Title of this code #include <stdio.h> #include <stdlib.h> #include <time.h> int main(void) { long a[100]; short i; long menor, mayor; for(srand(time(NULL)) , i = 0 ; i < 100 ; i++) { a[i] = 1 + rand() % 1000; } for(i = 0 ; i < 100 ; i++) { if(i % 8 == 0 && i) { printf("\n"); } printf("%4ld", a[i]); } for(mayor = menor = a[0] , i = 1 ; i < 100 ; i++) { if(menor > a[i]) { menor = a[i]; } if(mayor < a[i]) { mayor = a[i]; } } printf("\n\nMAYOR: %ld\n", mayor); printf("MENOR: %ld\n", menor); return 0; }
run
|
edit
|
history
|
help
0
Data Types
SIGABRT error
TruncatablePrime
C_141203_CTYPE
Hello
Project 3 part 2 Book v0.6
CALCULADORA
Tree
Lab 7 blackjack v0.1
C code to compare two texts in form of array of chars ignoring the capitalization