Exam 1 review COP3223C

0.0(0)
Studied by 1 person
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/33

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:35 PM on 6/6/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

34 Terms

1
New cards

Who developed the C programming language? 

Dennis M. Ritchie

2
New cards

When was C first implemented?

1972

3
New cards

Why is C widely used?  Select all that apply.

It can handle low-level activities

Structured language

Easy to learn

It can be compiled on a variety of computer platforms

4
New cards

Which language is C the successor of?

B

5
New cards

C runs nearly as fast as which other language?

Assembly language

6
New cards

What is the file extension of a C language source code file?

.c

7
New cards

What tools are required to set up an environment in order to write, compile, and run a program written in the C language?  Select all that apply.

Text editor

C compiler

8
New cards

What type of file contains the source code?

source files

9
New cards

What is source code compiled into?

machine language

10
New cards

Match the parts of the program with its definition.

-----------------------------------------------------------------

#include <stdio.h>

int main()
{
/* my first program in C */
printf("Hello, World! \n");

return 0;
}

#include <stdio.h> : preprocessor command

int main(): the main function where the programs execution begins

/* my first program in C */ : comments

 printf("Hello, World! \n"); : function available in C

return 0; : terminates the main() functions

11
New cards

Given the source code below, how many tokens make up the statement?

printf("Hello COP 3223!");

5

12
New cards

In a C program, an individual statement must be ended with a semicolon.

True

13
New cards

There are multiple formats of an acceptable comment in C, select all that apply.

/* comment */

// comment

14
New cards

Regarding identifiers for variables, functions, or any other user-defined item, which of the following are acceptable?  Select all that apply.

_variable

var23iable

variable

VARIABLE

15
New cards

Regarding keywords in the C programming language and creating identifiers.  Keywords are reserved in all lowercase AND all uppercase.

False

16
New cards

Regarding whitespace in the C programming language, spaces are required between the operators in the following source code in order to compile, run, and provide the correct output.

int sum=2+3/2-12*15;

False

17
New cards

Match the data type to its definition.

Basic Types

Enumerated types

void

Derived types

Aggregate types

Basic Types: Arithmetic types are further classified into integer and floating point types.

Enumerated types: Used to define variables that can only assign certain discrete integer values.

void: No value is available

Derived types: pointer, array, structure, union, Function types

Aggregate types: array and structure

18
New cards

What C operator is used to yield the storage size of the object or type in bytes?

sizeof(type)

19
New cards

Given the three situations the void type is used in C, match the associated code with the situation.

Function returns as void: void exit (int status);

Function arguments as void: int rand(void);

Pointers to void: void*malloc( size_t size )

20
New cards

Which of the following is true regarding a variable in C?  Select all that apply.

the data type determines the range of values that can be stored

the data type determines the set of operations that can be applied to the variable

the data type determines the layout of the variable's memory

has a specific type

the data type determines the size of the variable

21
New cards

Regarding basic data types in C, match the data type to its definition.

Char: typically one byte and is an integer

int: the most natural size of integer for the machine

float: a single precision floating point value

double: a double precision floating point value

void: represents the absences of type

22
New cards

A variable definition must include as a minimum which of the following?  Select all that apply.

int variableName = 53;

Data type

Semi-colon

Valid name

23
New cards

Which of the following is true regarding variable definition in C?  Select all that apply.

is useful when you are using multiple files

has its meaning at the time of compilation only

provides assurance to the compiler that there exists a variable with the given type and name

24
New cards

Constants can be altered during program execution.

False

25
New cards

Professional best practices state that when using constants in source code the syntax should be in which format?

upper case

26
New cards

Literals are not equivalent to fixed values in regard to computer programming in the C language. 

False

27
New cards

Which of the following is the correct implementation for defining a constant as a macro?

#define RATE 25

28
New cards

When defining a constant as a macro where should it be located?

outside all functions

29
New cards

When defining a constant in the main() function, which of the following is the correction implementation?

const int LENGTH = 10;

30
New cards

What does a storage class define regarding variables?

scope

life-time

visibility

31
New cards

Match the storage class to its definition.

auto

register

static

extern

auto: is the default storage class for all local variables

register: to define local variables that should be stored in a register instead of RAM

static: instructs the compiler to keep a local variable in existence during the life-time of the program

extern: to give a reference of a global variable that is visible to ALL the program files

32
New cards

Match the operator to its functionality.

+

*

%

--

==

+: adds two operands

*: multiplies two operands

%: remainder after integer division

--: decrements integer by one

==: checks if two operands are equal

33
New cards

Match the operator to its functionality.

>=

!=

!

||

&

>=: checks if left operand is greater than or equal to the right operand

!=: checks if two operands are not equal

!: used to reverse the logical state of its operand

||: if any of the two operands is non-zero, then the condition becomes true

&: bitwise AND

34
New cards

Match the operator to its functionality.

=

/=

sizeof()

?:

-=

=: assigns values from right side operands to left side operand

/=: it divides the left operand with the right operand and assigns the result to the left operand

sizeof(): returns the size of a variable

?:- conditional expression; if condition is true ? then value X : otherwise value Y

-=: it subtracts the right operand from the left operand and assigns the result to the left operand

Explore top flashcards

flashcards
Microscopic examination CASTS
34
Updated 657d ago
0.0(0)
flashcards
Zoology Exam 1
145
Updated 45d ago
0.0(0)
flashcards
Med Micro Case Studies
76
Updated 1196d ago
0.0(0)
flashcards
Y2 U1L1 Vamos a acampar
55
Updated 915d ago
0.0(0)
flashcards
Modern World History Midterm
51
Updated 205d ago
0.0(0)
flashcards
World History Exam
232
Updated 1033d ago
0.0(0)
flashcards
Concept of Globalization
22
Updated 1141d ago
0.0(0)
flashcards
Microscopic examination CASTS
34
Updated 657d ago
0.0(0)
flashcards
Zoology Exam 1
145
Updated 45d ago
0.0(0)
flashcards
Med Micro Case Studies
76
Updated 1196d ago
0.0(0)
flashcards
Y2 U1L1 Vamos a acampar
55
Updated 915d ago
0.0(0)
flashcards
Modern World History Midterm
51
Updated 205d ago
0.0(0)
flashcards
World History Exam
232
Updated 1033d ago
0.0(0)
flashcards
Concept of Globalization
22
Updated 1141d ago
0.0(0)