COMP10120

0.0(0)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/39

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:04 AM on 1/19/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

40 Terms

1
New cards
C Preprocessor Lines
Lines beginning with # that are processed before compilation;
2
New cards
#include directive
Tells the preprocessor to include the contents of a header file (like stdio.h) in the program;
3
New cards
stdio.h purpose
Header file containing information for standard input/output library functions like printf and scanf;
4
New cards
Function definition in C
C programs contain one or more functions, one of which must be main;
5
New cards
main function purpose
The function where a C program starts executing;
6
New cards
int before main
Keyword indicating that main returns an integer (whole number) value;
7
New cards
void in main parameters
Indicates that main does not receive any information/parameters;
8
New cards
printf function
Instructs the computer to print a string of characters on the screen;
9
New cards
Character string terms
Also called a message or a literal, marked by quotation marks;
10
New cards
Statement terminator in C
The semicolon (;) that ends each statement;
11
New cards
Escape character
The backslash (\) used to create special character sequences;
12
New cards
\n escape sequence
Newline - causes the cursor to position to the beginning of the next line;
13
New cards
\\ escape sequence
Prints a single backslash character;
14
New cards
\" escape sequence
Prints a double quote character within a string;
15
New cards
Standard library function
Functions like printf and scanf that are not part of C but are in the standard library;
16
New cards
Linker purpose
Locates library functions and inserts proper calls to them in the object program;
17
New cards
Executable
The complete, linked program ready to be executed;
18
New cards
Binary operators
Operators that require two operands (like + in 6 + 9);
19
New cards
* operator
Asterisk used for multiplication in C;
20
New cards
% operator
Percent sign denoting the remainder operator (modulo);
21
New cards
Integer division result
Yields an integer result (e.g., 8/5 = 1, 18/4 = 4);
22
New cards
Remainder operator usage
Only use % with integer operands to get the remainder after division;
23
New cards
Remainder operator example
8 % 5 yields 3, and 18 % 4 yields 2;
24
New cards
Parentheses in expressions
Used for grouping subexpressions to control order of operations (e.g., a * (b + c));
25
New cards
Operator precedence order
1. Parentheses/Brackets 2. Multiplication, division, remainder (left to right) 3. Addition, subtraction (left to right) 4. Assignment (=) evaluated last;
26
New cards
Variable definition
Locations in memory where values can be stored for use by a program;
27
New cards
int type
Specifies variables that store whole numbers (integers) like 9, -16, 0, 30675;
28
New cards
Valid identifier rules
Series of letters, digits, and underscores (_) that does not begin with a digit;
29
New cards
C case sensitivity
C treats uppercase and lowercase letters as different (e.g., sum ≠ Sum ≠ SUM);
30
New cards
scanf function purpose
Obtains input value from the user (usually from keyboard);
31
New cards
scanf arguments
Two arguments: format control string (like "%d") and address of variable (like &integer1);
32
New cards
%d conversion specifier
Indicates that the data should be a decimal integer in scanf or printf;
33
New cards
& address operator
Ampersand followed by variable name, tells scanf the memory location where the variable is stored;
34
New cards
Format control string
First argument in printf containing text and conversion specifiers (like "Sum is %d\n");
35
New cards
Multiple input reading
Can read multiple values with one scanf: scanf("%d%d%d", &a, &b, &c);
36
New cards
Variable components
Every variable has a name, a type, and a value;
37
New cards
Memory location placement
When scanf executes, the entered value is placed into the memory location assigned to that variable name;
38
New cards
Destructive memory write
When a value is placed in a memory location, it replaces the previous value;
39
New cards
Assignment statement
Calculates a result and assigns it to a variable using the = operator (e.g., sum = integer1 + integer2);
40
New cards
Assignment operator nature
The = operator is a binary operator because it has two operands;