Search Header Logo

C Quiz-IT-B(Arrays & Pointers)

Authored by roja laveti

Computers

University

Used 4+ times

C Quiz-IT-B(Arrays & Pointers)
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for declaring a pointer in C?

int ptr;


ptr = int;


int *ptr();


int *ptr;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the size of a pointer variable in C?

4 bytes (on a 32-bit system) or 8 bytes (on a 64-bit system)

10 bytes

2 bytes


16 bytes

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What do the following declaration signify?

char *arr[10];

arr is a array of 10 character pointers.


arr is a array of function pointer.

arr is a array of characters.


arr is a pointer to array of characters.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for declaring an array in C?


array_name = [array_size];

array_name = data_type[array_size];


array_name[array_size] = data_type;

data_type array_name[array_size];

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between array and pointer in C?

Arrays are a fixed-size collection of elements, while pointers are variables that store memory addresses.

Arrays cannot be passed as arguments to functions, while pointers can

Arrays can only store integers, while pointers can store any data type

Arrays and pointers are the same thing

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Choose a correct array statement.


An array size can not changed once it is created.


Array element value can be changed any number of times

To access Nth element of an array students, use students[n-1] as the starting index is 0.

All the options

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of C Program.?

int main()

{

int a[];

a[4] = {1,2,3,4};

printf("%d", a[0]);

}

1


Compiler Error

4

2

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?