Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
B_141125_MenorMayor
//Title of this code #include <stdio.h> #include <stdlib.h> #include <time.h> #define _T 100 int main(void) { long v[_T]; long a, b; short i; long mayor, menor; printf("Valor de a ... "); scanf(" %ld", &a); printf("Valor de b ... "); scanf(" %ld", &b); if(a > b) { a ^= b; b ^= a; a ^= b; } for(srand(time(NULL)) , i = 0 ; i < _T ; i++) { v[i] = a + rand() % (b - a + 1); } for(i = 0 ; i < _T ; i++) { if(i % 10 == 0 && i) { printf("\n"); } printf("%6ld", v[_T]); } for(menor = mayor = v[0] , i = 1 ; i < _T ; i++) { if(mayor < v[i]) { mayor = v[i]; } if(menor > v[i]) { menor = v[i]; } } printf("\n\nMenor: %ld", menor); printf("\nMayor: %ld", mayor); return 0; }
run
|
edit
|
history
|
help
0
B_141121_aleatorios
bitwise operations
150109_RecursividadFactorial
lol
project 5 v.075
Text to ASCII (top)
day 3 integer manipulation
PREGUNTA 2, GUÍA 4, MÓDULO 3
Strncpy memcpy
structt