Your SlideShare is downloading. ×
  • Like
  • Save
VECTOR ASCENDENTE
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply
Published

 

Published in Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
409
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 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. 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. ____________________________________________________________________________________________________________________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. 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.____________________________________________________________________________________________________________________