wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Computer Programming (Lab)

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is an Array in C language.?

a)

A group of elements of same data type.

b)

An array contains more than one element

c)

Array elements are stored in memory in continuous or contiguous locations.

d)

All the above.

2.

Choose a correct statement about C language arrays.

a)

An array address is the address of first element of array itself.

b)

An array size must be declared if not initialized immediately.

c)

Array size is the sum of sizes of all elements of the array.

d)

All the above..

3.

What are the Types of Arrays.?

a)

int, long, float, double

b)

struct, enum

c)

char

d)

All the above...

4.

An array Index starts with.?

a)

-1

b)

0

c)

1

d)

2

5.

An entire array is always passed by ___ to a called function.

a)

Call by value

b)

Call by reference

c)

Address relocation

d)

Address restructure

6.

What is a String in C Language.?

a)

String is a new Data Type in C

b)

String is an array of Characters with null character as the last element of array.

c)

String is an array of Characters with null character as the first element of array

d)

String is an array of Integers with 0 as the last element of array.

7.

Choose a correct statement about C String.

char ary[]="Hello..!";

a)

Character array, ary is a string.

b)

Array has no Null character at the end

c)

String size is not mentioned

d)

String can not contain special characters.

8.

What is the Format specifier used to print a String or Character array in C Printf or Scanf function.?

a)

%c

b)

%C

c)

%s

d)

%w

9.

What is the output of C Program with Strings.?

int main()

{

char ary[]="Discovery Channel";

printf("%s",ary);

return 0;

}

a)

D

b)

Discovery Channel

c)

Discovery

d)

Compiler error

10.

What is the output of C Program with Strings.?

int main()

{

char str[]={'g','l','o','b','e'};

printf("%s",str);

return 0;

}

a)

g

b)

globe

c)

globe\0

d)

None of the above...