Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
A_141124Burbuja
//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, j; short chivato; printf("Valor de a ... "); scanf(" %ld", &a); printf("Valor de b ... "); scanf(" %ld", &b); if(a > b) { a ^= b; b ^= a; a ^= b; } printf("\n\n"); 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("%5ld", v[i]); } for(chivato = 0 , i = 0 ; i < _T && chivato == 0 ; i++) { for(j = i + 1 ; j < _T && chivato == 0 ; j++) { if(v[i] == v[j]) { chivato = 1; } } } if(chivato == 1) { printf("\nSÍ VALORES REPETIDOS\n"); } else { printf("NO VALORES REPETIDOS\n"); } return 0; }
run
|
edit
|
history
|
help
0
Tree
a3 commented
Nice1
Project 3 Part 1 v1.4
a.out
MATRICES DE CADENAS CON PUNTEROS
use_of_bool_in_loop
18BCE2182 ASSESS_1 Q1-7
C programming example that implements a modified string length function (from ECE 2534)
Coba