Jump to content
Sign in to follow this  
TheVirus

[PASCAL] Afișarea suma vectorilor (tablou unidimensional)

Recommended Posts

Descriere: Se dă de la tastatură dimenisiunea și elementele numerelor întregi ale unui vector. Să se afișeze suma vectorilor.
Alte precizari: Acest tip de exercitiu este unul de introducere.

Conținutul programului:

 

uses: crt;

type sir=array [1..100] of integer;

var v:sir;

n,i,s:byte;

begin

clrscr;

write('n= ');

readln(n);

s:=0;

for i:=1 to n do

begin

write('v[',i,']= ');

readln(v);

end;

for i:=1 to n do

s:=s+v;

write('Suma este:', s);

readln

end.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.