You are on page 1of 2

program addition; => var sum,row,col : integer; var matrix1,matrix2,resultant: array[1..3,1..

3] of integer; => begin => for row =1 to 3 do for col = 1 to 3 do => write(matrix1[row,col]); readln; => for row= 1 to 3 => for col= 1 to 3 do; write(matrix2[row,col]); => readln; for row= 1 to 3 => for col= 1 to 3 resultant[row,col]=matrix1[row,col]+ matrix2[row,col]; => readln; for row= 1 to 3 do => begin => col=1; writeln(resultant*row,col+,,resultant*row,col+,, resultant[row,col]); => readln; => col=col+1; end; => writeln(press any key to exit.); =>readln; end. Program Fibonacci series; Var a, b, temp, limit, i:integer ; => Begin a=0 => b=1 => temp=0 write(enter limit to start series: ); readln (limit); => while i <= limit do begin => writeln(a:5); a=a=b; => b=temp; => temp=a; = > i = i+1 => end; writeln(press any key to exit.); readln; => end.

RESET: The reset procedure associates a file variable with a file (i.e. opens the file variable and allows it to be used to manipulate the file). The reset procedure opens the file variable in read-only mode. The open procedure can also be used to open file variables in read-only mode. REWRITE: The rewrite procedure associates a file variable with a file (i.e. opens the file variable and allows it to be used to manipulate the file). The rewrite procedure opens the file variable in write-only mode. The open procedure can also be used to open file variable in write-only mode. CALL BY VALUE: Passing a variable by value makes a copy of the variable before passing it onto a function. This means that if you try to modify the value inside a function, it will only have the modified value inside that function. One the function returns, the variable you passed it will have the same value it had before you passed it into the function. CALL BY REFERENCE: There are two instances where a variable is passed by reference: (1)When you modify the value of the passed variable locally and also the value of the variable in the calling function as well. (2)To avoid making a copy of the variable for efficiency reasons. RESET: The reset procedure associates a file variable with a file (i.e. opens the file variable and allows it to be used to manipulate the file). The reset procedure opens the file variable in read-only mode. The open procedure can also be used to open file variables in read-only mode. REWRITE: The rewrite procedure associates a file variable with a file (i.e. opens the file variable and allows it to be used to manipulate the file). The rewrite procedure opens the file variable in write-only mode. The open procedure can also be used to open file variable in write-only mode.

CALL BY VALUE: Passing a variable by value makes a copy of the variable before passing it onto a function. This means that if you try to modify the value inside a function, it will only have the modified value inside that function. One the function returns, the variable you passed it will have the same value it had before you passed it into the function. CALL BY REFERENCE: There are two instances where a variable is passed by reference: (1)When you modify the value of the passed variable locally and also the value of the variable in the calling function as well. (2)To avoid making a copy of the variable for efficiency reasons. BREAK: The break command will exit a loop at any time. The following program will not print anything bcz it exits The loop befor it gets there. Program Loops; Var => i : Integer; => Begin => i : = 0 ; => Repeat i : = i + 1 ; => Break ; => Writeln (i) ; => until i = 10 ; end CONTINUE: The continue command will jump back to the top of a loop.This example will also not print anything but unlike the break example, It wil count all the way to 10. REPEAT-UNTIL : The repeat-until loop is like the while loop except that it tests the condition at the bottom of the loop. It also doest have a begin & an end if it has more than one command inside it. WHILE-DO: This type of loop is executed while the condition is true.It is different from the Repeat-Until loop since the loop might not be executed for at least one time. EXIT: The exit procedure terminates the program or the function or procedure in which it is used, and optionally may return a value to the caller. If used in a function then the exit procedure terminates the function.If used in a procedure then exit terminates the procedure. HALT: The halt procedure terminates the program and optionally returns an integral value to the program's caller. The halt procedure's only paramter is optional, and if supplied is an expression of integral type that is the value returned by the program. TOP-DOWN- PROGRAMMING LOGIC: Carried out by developing an informal outline,consisting Phrases/sentences that one from english and pascal party.Boundaries of top down programming are begin, end,program, etc and the material inside these boundaries often programming components and referred as pseudocode. It is used to develop main block as-in-development of each module.

You might also like