You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
N = input('Digite o valor N: ');<br />
fprintf(1,’Digite os %d valores da variavel composta:',N);<br />
for C = 1 : N<br />
vetor(C) = input('');<br />
end<br />
for C = 1 : N - 1<br />
for I = 1 : N - C<br />
if (vetor(I) > vetor(I + 1))<br />
auxiliar = vetor(I);<br />
vetor(I) = vetor(I + 1);<br />
vetor(I + 1) = auxiliar;<br />
end<br />
end<br />
end<br />
fprintf(1,’A variavel composta ordenada em ordem crescente eh:\n');<br />
for C = 1 : N<br />
fprintf(1,’%f ',vetor(C));<br />
end<br />
<strong>UFMG</strong> – ICEx – DCC – Programação de Computadores – 2º. Sem 2005 – David Menoti 52