In Format Iva

3
Ex.1 1-1 2-7 3-8 4-5 5-4 Ex.2 Functiile sint subprogram care calculeaza si returneaza o valoare.In calitate de parametru poate fi o variabila,o expresie,o observatie prima.Parametri formali sint disponibili numai in cazul functiei. Nr de parametric actuali trebuie sa fie egal cu nr de par. Formali din declaratia functiei. Ex.3 A F A F Ex.5 Program P1; Var x:real; Function excuatie:real; Var f:real; F:=3/(4*x)+sqrt(6);ecuatie:=f; end; Begin Writeln(‘Introduceti x’); readln(x); Writeln(‘f(x)=’,ecuatie; Readln; End. Ex.8 Program P1; Var med:real; r,max,imp,sum,I,n,j,m:integer; A:array[1..100,1..100] of integer; Procedure Introd; Begin For 1:=1 to n do For j:=1 to m do begin Writeln(‘A[‘,I,j,’]=’); readln(A[I,j]); end; end; Procedure Afisare; Begin; For i:=1 to n do begin For j:=1 to m do Write (A[I,j]:3); end;end; Procedure media; Sum:=0 ; r:=0; Begin For i:=1 to n do For j:=1 to m do begin If i=1 then begin sum:=sum+A[i] ; r:=r+1; end; end; Med:=sum/r; Writeln(‘Media de e primul rind =’,med); readln;end. Function maxim:integer; Begin Max:=A[1,1] For 1:=1 to n do For j:=1 to m do begin If max<A[I,j then max:=A[I,j] ; end; Maxim:=max; end; Function impart;integer; Begin; imp:=0; For i:=1 to n do For j:=1 to m do begin If A[i] mod 14 =0 then imp:=imp+1;end;impart:=imp;end; Begin Writeln(‘Introd.n si m’); readln(n,m); Introd; Afisare; Writeln(‘Elementul maxim=’,max); Writeln(‘La 14 se impart fara rest’,impart,’numere din tablou’);readln;end. Ex.9 Program P1; Var s:string; i:integer; begin; Writeln(‘Introd sir’);readln(s); For i:=1 to lengh(s) do begin If s[i]=’B’ then s[i]:=’T’; If s[i]=’b’ then s[i]:=’t’; End;writeln(s);readln;end. Ex10 Program P2; Type Orange=record; Nume,prenume:string[20]; tip_abon:string; Nr_tel_cl: Val_cont:integer; end; Var A:array[1..100] of Orange; I,n:integer; Begin writeln('intr. nr. de clienti:');readln(n);

description

gfh

Transcript of In Format Iva

Ex.1 1-1 2-7 3-8 4-5 5-4Ex.2Functiile sint subprogram care calculeaza si returneaza o valoare.In calitate de parametru poate fi o variabila,o expresie,o observatie prima.Parametri formali sint disponibili numai in cazul functiei.Nr de parametric actuali trebuie sa fie egal cu nr de par. Formali din declaratia functiei.Ex.3 A F A FEx.5 Program P1;Var x:real;Function excuatie:real;Var f:real;F:=3/(4*x)+sqrt(6);ecuatie:=f; end;BeginWriteln(Introduceti x); readln(x);Writeln(f(x)=,ecuatie;Readln;End.Ex.8 Program P1;Var med:real; r,max,imp,sum,I,n,j,m:integer;A:array[1..100,1..100] of integer;Procedure Introd;BeginFor 1:=1 to n doFor j:=1 to m do beginWriteln(A[,I,j,]=); readln(A[I,j]); end; end;Procedure Afisare;Begin;For i:=1 to n do beginFor j:=1 to m doWrite (A[I,j]:3); end;end;Procedure media;Sum:=0 ; r:=0;BeginFor i:=1 to n doFor j:=1 to m do beginIf i=1 then begin sum:=sum+A[i] ; r:=r+1; end; end;Med:=sum/r; Writeln(Media de e primul rind =,med); readln;end.Function maxim:integer;BeginMax:=A[1,1]For 1:=1 to n doFor j:=1 to m do begin If max