Arrays in C

Arrays in C

University

15 Qs

quiz-placeholder

Similar activities

BCSC0006 - Quiz 2 - Big-Oh Notation

BCSC0006 - Quiz 2 - Big-Oh Notation

University

10 Qs

DWD - Unit -1

DWD - Unit -1

University

20 Qs

Linked List

Linked List

University

14 Qs

Arrays in C (II yr 02.07.2020)

Arrays in C (II yr 02.07.2020)

University

10 Qs

Computer programming-Array

Computer programming-Array

University

10 Qs

DIPLOMADO G2

DIPLOMADO G2

University

10 Qs

C Program Array and strings

C Program Array and strings

University

10 Qs

PLSQL-Introduction

PLSQL-Introduction

University

12 Qs

Arrays in C

Arrays in C

Assessment

Quiz

Computers

University

Hard

Created by

Satheesh D

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an array in C programming?

A method for sorting data

A type of function

A collection of different data types

A sequential collection of similar data items

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How is a single-dimensional array declared in C?

size array_name[datatype];

datatype array_name[size];

array_name[size] datatype;

datatype[size] array_name;

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the index range for an array of size n?

0 to n

1 to n-1

0 to n-1

1 to n

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a method to store values in an array?

Initialization

Declaration

Function calling

Memory allocation

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the scanf() function do in C?

Declares variables

Prints output to the screen

Allocates memory for arrays

Reads input from the keyboard

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the NULL character in strings?

To allocate memory

To store the length of the string

To initialize the string

To indicate the end of the string

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you initialize a string in C?

char str[] = 'Hello';

char str[5] = 'Hello';

char str[5] = "Hello";

char str[] = "Hello";

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?