____________________________________________________________________________________________________________________progra...
gotoxy(j,2);read(vec[i]);end;for i:=1 to n-1 dobeginfor j:=i+1 to n dobeginif vec[i]>vec[j] thenbeginaux:=vec[i];vec[i]:=v...
____________________________________________________________________________________________________________________progra...
aux:=vec[i];vec[i]:=vec[j];vec[j]:=aux;end;end;end;j:=-2;for i:=1 to n dobeginj:=j+6;gotoxy(j,10);write(vec[i]);end;readke...
Upcoming SlideShare
Loading in...5
×

VECTOR ASCENDENTE

425

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
425
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

VECTOR ASCENDENTE

  1. 1. ____________________________________________________________________________________________________________________program VectorAscendente;uses crt;varvec:array[1..14]of integer;j,i,aux,n:integer;begintextbackground(4);textcolor(2);clrscr;gotoxy(3,2);writeln(PROGRAMA VECTORES: METODO BURBUJA.);gotoxy(3,4);writeln(Este programa permite almacenar 13 numeros y ordenarlos de formaascendente.);gotoxy(3,6);write(Cuantos datos desea almacenar: );read(n);while (n<1) or (n>13) dobegingotoxy(3,8);write(Rango del numero no permitido);gotoxy(3,9);write(Ingrese de nuevo el numero de datos a almacenar: );clreol;read(n);end;clrscr;j:=-2;for i:=1 to n dobeginj:=j+6;
  2. 2. gotoxy(j,2);read(vec[i]);end;for i:=1 to n-1 dobeginfor j:=i+1 to n dobeginif vec[i]>vec[j] thenbeginaux:=vec[i];vec[i]:=vec[j];vec[j]:=aux;end;end;end;j:=-2;for i:=1 to n dobeginj:=j+6;gotoxy(j,4);textcolor(yellow);write(vec[i]);end;readkey;end.____________________________________________________________________________________________________________________
  3. 3. ____________________________________________________________________________________________________________________program VectorMetodoBurbuja;uses crt;varvec:array[1..13]of integer;j,i,aux,n:integer;begintextbackground(4);textcolor(2);clrscr;gotoxy(3,2);writeln(PROGRAMA VECTORES: METODO BURBUJA.);gotoxy(3,4);writeln(Este programa permite almacenar 13 numeros y ordenarlos de formaascendente.);gotoxy(3,6);write(Cuantos datos desea almacenar: );read(n);textcolor(yellow);j:=-2;for i:=1 to n dobeginj:=j+6;gotoxy(j,8);read(vec[i]);end;for i:=1 to n-1 dobeginfor j:=i+1 to n dobeginif vec[i]>vec[j] thenbegin
  4. 4. aux:=vec[i];vec[i]:=vec[j];vec[j]:=aux;end;end;end;j:=-2;for i:=1 to n dobeginj:=j+6;gotoxy(j,10);write(vec[i]);end;readkey;end.____________________________________________________________________________________________________________________

×