0% found this document useful (0 votes)
3 views8 pages

Typ Program for Matrix Operations

This document defines procedures and functions for working with matrices and arrays in Pascal, including: 1) Procedures to read from and write to a matrix. 2) A procedure to swap the elements of two arrays. 3) A function that returns the index of the minimum or maximum element of a matrix, depending on the sign of a given parameter.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views8 pages

Typ Program for Matrix Operations

This document defines procedures and functions for working with matrices and arrays in Pascal, including: 1) Procedures to read from and write to a matrix. 2) A procedure to swap the elements of two arrays. 3) A function that returns the index of the minimum or maximum element of a matrix, depending on the sign of a given parameter.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

program razm enavrsta;typ e opseg=1..

10; niz = array[opseg] of integer;matr ica=array[op

seg] of niz;var m,n,l,s:opse g;a:matrica; c:niz;proced ure citaj(m,n:op seg; var x:matrica);v

ar i,j:opseg;be ginfor i:=1 to m dobeginfor j :=1 to n do read(x[i] [j]); readln ;endend;proc

edure pisi(m,n:ops eg; x:matric a);var i,j:opseg;be ginfor i:=1 to m dobeginfor j :=1 to n do

write(x[i] [j],' '); wr iteln;endend ;procedure razmenivrste (var a,b:niz);var p:niz;beginp :=a; a:=b;

b:=p;end;fun ction indminmax(m, n,p:integer; a:matrica):i nteger;var i,j,k:intege r;minmax:rea l;begink:=1;

minmax:=a[1] [1];for i:=1 to m dofor j:=1 to n doif p*a[i] [j]<p*minmax thenbeginmin max:=a[i] [j];

k:=i;end;ind minmax:=k;en d;begin

You might also like