0% found this document useful (0 votes)
25 views2 pages

Programa Vector

Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views2 pages

Programa Vector

Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

include <oistream.h> include <conio.h> include <ctype.

h> void void void void llenado (int n; vect[]) ordenamiento (int n, vect[]) impresion (int n, vect[]) busqueda (int n, vect[])

main () { char resp; do { clrscr(); llenado(n, vect); ordenamiento(n, vect); impresion(n, vect); busqueda(n, vect); do { cout << "Continuar S/N:" cin >> resp; resp=toupper(resp) } while (resp!='S' && resp!='N'); } while(resp='S'); } void llenado (int ,; vect[]); { int dato; cout << "Cuantos datos vas a ingresar"; cin >> n for (i=0; i<=n;i++) { cout << "vect["i"]"; cin >> dato; } } void ordenamiento (int n; vect[]) { int aux; for (i=0;i<=n-1;i++) for (j=i+1; j<=n; j++) if(vect[i]>vect[j]) { aux=vect[i]; vect[i]=vect[j]; vect[j]=aux } } void impresion (int n, vect[]) { for(i=0; i<=n; i++) { cout << "Vector[i]=", vect[i];

} } void busqueda (int n, vect[]) { int cont, num; char resp; do { cont=0; cout << "Numero a buscar"; cin >> "num" for(i=0; i<=n; i++) { if(num = vect [i]) { cout << num "Se encuentra en la posicion", i; cont = cont +1; } } do { cout << "Otra busqueda S/N"; cin >> resp; } while(resp = 'S' y resp = 'N') } while (resp='S') }

You might also like