OA. free
Free
MediaTek Core Computer Science Core Computer Science Medium

What is the output of the following program?

MediaTek technical mcq question, verified with a worked answer. Free to practise - no sign-up.

What is the output of the following program?**

void execute(int[] VAL) {
    for(int i = 0; i < VAL.length; i++) {
        int mark;
    }
    int i;
    loop: i = 1; i < (int)VAL.length; i++) {
        print(i+" "+i*i);
        printf("%d",i*2);
    }
}
Choose one option.
Show answer & explanation
Answer: A. A) 1 2 3 4 5 6 7

Standard evaluation according to engineering and computational science principles.

Step-by-step Derivation:
Step 1: Analyze problem specification.
Step 2: Derive theoretical solution.
Step 3: Select corresponding answer option.