pointers and arrays

pointers and arrays

University

15 Qs

quiz-placeholder

Similar activities

2D Array and Strings in C

2D Array and Strings in C

University

16 Qs

C Basics

C Basics

University

12 Qs

PSC ALM QUIZ

PSC ALM QUIZ

University

16 Qs

Java Programming

Java Programming

University

20 Qs

Quiz - Control Structure in C programming

Quiz - Control Structure in C programming

University

15 Qs

Milking Minds 2 17-01-24

Milking Minds 2 17-01-24

University

15 Qs

CIS1101-programming practice2

CIS1101-programming practice2

University

10 Qs

C Programming

C Programming

University

20 Qs

pointers and arrays

pointers and arrays

Assessment

Quiz

Computers

University

Hard

Created by

Karen Tan

Used 2+ times

FREE Resource

15 questions

Show all answers

1.

OPEN ENDED QUESTION

5 mins • 10 pts

Identify and write the error and the correct code line from the code snippet below:
int i = 0;

while (i < 5);

    printf("%d ", i++);

Evaluate responses using AI:

OFF

2.

OPEN ENDED QUESTION

5 mins • 10 pts

Identify and write the error and the correct code line from the code snippet below:
Description: a loop for an array with 5 elements

for (int i = 0; i <= 5; i++) {

    printf("%d ", i);

}

Evaluate responses using AI:

OFF

3.

OPEN ENDED QUESTION

5 mins • 10 pts

Identify and write the error and the correct code line from the code snippet below:
for (int i = 0; i < 5; i--) {

    printf("%d ", i);

}

Evaluate responses using AI:

OFF

4.

OPEN ENDED QUESTION

5 mins • 10 pts

Identify and write the error and the correct code line from the code snippet below:
int i;

while (i < 5) {

    printf("%d ", i++);

}

Evaluate responses using AI:

OFF

5.

OPEN ENDED QUESTION

5 mins • 10 pts

Identify and write the error and the correct code line from the code snippet below:
for (int i = 0; i < 5; i++) {

    if (i == 3);

        break;

    printf("%d ", i);

}

Evaluate responses using AI:

OFF

6.

OPEN ENDED QUESTION

5 mins • 10 pts

Identify and write the error and the correct code line from the code snippet below:
description: add function accepts 2 integer parameters and returns the integer sum result

int add(int a, int b) {

    int sum = a + b;

}

Evaluate responses using AI:

OFF

7.

OPEN ENDED QUESTION

5 mins • 10 pts

Identify and write the error and the correct code line from the code snippet below:
void multiply(int a, int b) {

    return a * b;

}

Evaluate responses using AI:

OFF

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?