Home » mcq » Visual basic » . . . . . . . . returns a value after performing its specific task.
Function Procedure
Sub procedure
Sub block
Structure
Answer is Right!
Answer is Wrong!
The correct answer is A. Function Procedure.
A function procedure is a block of code that is called by another block of code. It can be used to perform a specific task and return a value.
A sub procedure is a block of code that is called by another block of code. It cannot return a value.
A sub block is a block of code that is contained within another block of code. It cannot be called by another block of code.
A structure is a data type that can be used to store data. It cannot be used to perform a
288 64 288 64S117.2 64 74.6 75.5c-23.5 6.3-42 24.9-48.3 48.6-11.4 42.9-11.4 132.3-11.4 132.3s0 89.4 11.4 132.3c6.3 23.7 24.8 41.5 48.3 47.8C117.2 448 288 448 288 448s170.8 0 213.4-11.5c23.5-6.3 42-24.2 48.3-47.8 11.4-42.9 11.4-132.3 11.4-132.3s0-89.4-11.4-132.3zm-317.5 213.5V175.2l142.7 81.2-142.7 81.2z"/> Subscribe on YouTube
task.
Here is an example of a function procedure:
function add(x, y) {
return x + y;
}
This function procedure can be called by another block of code, such as this:
var z = add(1, 2);
The value of z will be 3.
Here is an example of a sub procedure:
sub printMessage() {
print("Hello, world!");
}
This sub procedure cannot be called by another block of code. It can only be called by the block of code that contains it.
Here is an example of a sub block:
{
var x = 1;
var y = 2;
}
This sub block is contained within another block of code. It cannot be called by another block of code.
Here is an example of a structure:
struct Person {
string name;
int age;
}
This structure is a data type that can be used to store data. It cannot be used to perform a task.