Lab 10
Lab 10
Lab Task
Question 1:
Local Variables with LOCAL Directive:
Create a procedure that initializes a local variable using the LOCAL directive. Use the variable
to store and print a constant value.
Question 2:
Using Arrays and Loops:
Write a program that defines an array of 5 integers. Use a procedure to calculate the sum of the
elements in the array using a loop. Pass the address of the array to the procedure through the
stack.
Question 3:
Procedure to Find Minimum in an Array:
Create a procedure that finds the minimum value in an array of integers. Pass the array's address
and size through the stack. Use the LOCAL directive to store intermediate values like the current
minimum.
Question 4:
Sorting an Array Using Bubble Sort:
Implement a procedure that sorts an array of integers in ascending order using the bubble sort
algorithm. Pass the array's address and size through the stack. Use local variables for temporary
storage and swapping.