Search Header Logo

Week 4 - Compound Types in C/C++

Authored by Hai Minh Nguyen

Computers

University

Used 32+ times

Week 4 - Compound Types in C/C++
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which code is correct to create an array of 20 shorts?

short arr[20];

short int[20];

int arr[20];

int arr[] = {20};

2.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Find all correct initializations of array.

int yam[3] = {20,30,40};

int yam[] = {20,30,40};

int yam[3] {20,30,40};

int yam[] {20,30,40};

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Is the following code correct?

int my_array[4] = {1, 2, 3};

Correct

Incorrect

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Is the following code correct?

int my_array[3];

my_array[3] = {1, 2, 3};

Correct

Incorrect

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Is the following code correct?

int yam[4] = { 2, 4, 6, 8 };

int yell[4] = { 1, 3, 5, 7 };

yell = yam;

Correct

Incorrect

6.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Select all answers that declare an array of 4 integers and set all element values to 0

int yam[4] = { };

int yam[4] { };

int yam[4] = {0};

int yam[] = {0};

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output?

hi65

hiA

hi

Error

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?