Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Untitled
SUBMITTED BY:
Guest
DATE:
Feb. 1, 2014, 2:07 a.m.
FORMAT:
Text only
SIZE:
788 Bytes
Raw
Download
Tweet
HITS:
7141
Go to comments
Report
// 5. Declare um vetor de N posições e o preencha com os N primeiros números ímpares escrevendo-o ao final.
Program vetnumero5 ;
uses crt;
const n = 10;
var i, impar: integer;
vet : array [1..n] of integer;
Begin
clrscr;
writeln ('Existem ',n,' casa nesse vetor.');
writeln;
writeln ('Eis os primeiros ',n,' números ímpares para esse vetor de ',n,' casas: ');
writeln;
impar := -1;
for i := 1 to n do
begin
impar := (impar + 2);
vet[i] := impar;
write ('[',vet[i],'] ');
end;
writeln;
writeln;
writeln ('Pressione qualquer tecla para encerrar.');
End.
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus