Documente Academic
Documente Profesional
Documente Cultură
Alege n trei coloane din mrimile date care snt din tipurile de
date integer, real, char: -256, true., +23., a., 9., x., false., y., d.,
ax., +., ., (., 98., ).,+32768,new(r),2,9*10-39, 2,9*10-40
Boolean____________________________________________
Integre _____________________________________________
Real _______________________________________________
Char _______________________________________________
2. program p1;
const c=1;
function f1(x:integer):integer;
begin
f1:=x+c;
end;
function f2(c:real):real;
const x=2.0;
begin
f2:=x+c;
end;
function f3(x:char):char;
const c=3;
begin
f3:=chr(ord(x)+c);
end;
begin
writeln ('f1=',f1(1));
writeln ('f2=',f2(1));
writeln ('f3=',f3('1'));
end.
Ce va afia programul dat
__________________________________________________________________
__
__________________________________________________________________
__
__________________________________________________________________
__
__________________________________________________________________
__
3.
a). Not
A-F
b). Then
A-F
c). Var
A-F
d). Or
A-F
e). And
A-F
Fals Fals
e
e
Fals True
e
Tru
e
Fals
e
Tru
e
True
X and
Y
Program Numar1;
Var z,m: string;
Var i : integer;
Begin
w:=;
for i:=1 to length(s) do
if s[i] in [a..z, A..Z ] then
w:=w+s[i];
End;
II) Enumerati:
Begin
Write(m=); Readln( m );
Variabilele globale:
P( m , z);
Writeln( z );
End.
Variabilele locale...
Parametri actuali.
6. Program p1;
{Media aritmetica a numerelor pozitive dintr-un sir }
Var n,k: integer;
x,s: real;
begin
n:=0; k:=0; s:=0;
writeln (Dati un ir de numere reale; ( ;
While not eof do
Begin
Readln (x);
n:=n+1;
if x>0 then
begin k:=k+1; s:=s+x;
end; end;
if n=0 then writeln (sir vid) else if k=0 then writeln ( sirul nu
contine numere pozitive ); else writeln (media=,s/k);
readln; end.
Elaborati un program care calculeaza media aritmetica a
numerelor mai mici ca zero
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________