wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CS1010 Lab 01

Total questions: 11

Worksheet time: 6mins

Name
Class
Date
1.

What is the correct file extension for C source files?

a)

.java

b)

.c

c)

.cpp

d)

.cfile

2.

Which of the following is NOT a basic data type in C?

a)

integer

b)

real number

c)

character

d)

string

3.

Consider the function foo().  What is the value of b at Line A?

a)

foo() causes an error.

value of variable b cannot be determined

b)

b contains the value of 15

c)

b contains the value of 5

d)

b contains the value of 75

4.

In a flowchart, which symbol is used to represent a decision point?

a)

diamond

b)

rectangle

c)

oval

d)

arrow

5.

What function would calculate the weighted mean given a list L and weights W :

a)
  • divide(sum(multiply(L, W)), W)

b)
  • multiply(mean(L), mean(W))

c)
  • divide(sum(multiply(L, W)), sum(W))

d)
  • sum(divide(multiply(L, W), W))

6.

Given the mathematical function for the variance of a list L :
Which function represents this operation?

a)
  • mean(subtract(L, square(mean(L))))

b)
  • sum(square(subtract(L, mean(L))))

c)
  • divide(square(subtract(L, mean(L))), n)

d)
  • mean(square(subtract(L, mean(L))))

7.

For the operation of standardizing a list L, which function is correct?

a)
  • divide(L, stddev(L))

b)
  • subtract(L, mean(L))

c)
  • divide(subtract(L, mean(L)), stddev(L))

d)
  • divide(subtract(L, stddev(L)), mean(L))

8.

How many bits minimally are needed to represent number 0-64?

a)

5

b)

6

c)

7

d)

8

9.

Which of the following is not a data type in C?

a)

int

b)

short

c)

long

d)

real

10.

What is the size of an int data type in C on a 32-bit system?

a)

1 byte

b)

4 bytes

c)

16 bytes

d)

32 bytes

11.

Which is true about unsigned and signed data type?

a)

unsigned type uses less bytes

b)

signed data type represent only non-negative numbers.

c)

signed type can represent more values

d)

unsigned type cannot represent negative values