C syntax and other concepts Flashcards
named data storage location in computer memory
variable
2 main categories of data types
Integer variables
Floating-point variables
variables with decimals
Floating-point variables
variables with signed and unsigned integers
Integer variables
3 major scopes rules in c [variable declaration]
- local variable
- formal variable
- global variable
variable declared within a function
local variable
declared arguments of a function
formal variable
declared outside all functions
global variable
2 types of constants
- literal constant
2. symbolic constant
constants that can still be changed during program execution
literal constant
constants that can still be changed during program execution
literal constant
symbol that instructs to perform operands
operators
categories of operators
- assignment operator
- logical operators
- mathematical operators
operator used for assigning value
Assignment operators
two kinds of mathematical operators
- Unary mathematical operators
2. Binary mathematical operators
operators that compare expressions
Relational operators
two types of conditional statements
- If
2. switch
pre-defined loops
for loops
open-ended loops
while and do loops
[LOOPS] sets a variable to a specific value
initial
[LOOPS] usually relational expression that’s when equated to false, the loop terminates
condition
[LOOPS] skip the current iteration to go to the start of a loop
continue
[LOOPS] terminates the program execution
exit()
[LOOPS] terminates the program execution
exit()
[LOOPS] terminates the program execution
exit()
[LOOPS] skip past the end of the current loop
break
[LOOPS] has a label for where a program jumps to after meeting the set condition
goto statement
increments a variable with initial value
increment
executable processes
statements
statement that allows for multiple branches in a single expression
Switch statement
3 possible things in a format string
- literal text
- escape sequence
- conversion specifier
characteristics of C language
- general-purpose programming language
- middle-level programming language
- system programming language
inventor of B language
Ken Thompson
[Characteristics]
- data processing application (large volume of data)
- scientific applications (complex mathematical computations)
General-purpose programming language
[Characteristics]
- can be used for interface assembly language
Middle-level programming language
[Characteristics]
- Operating System can be developed using C
System Programming Language
What C offers? Enumerate the 7.
- program sequence of instructions (IPO)
- conditions
- iterations
- arrays
- functions
- file handling
- pointers
[Bytes]
short and int
2 bytes
[Bytes]
long int
4 bytes
[Bytes]
unsigned short and long
2 bytes
[Bytes]
unsigned long int
4 bytes
[Bytes]
float
4 bytes
[Bytes]
double
8 bytes
[Bytes]
long double
10 bytes
2 uses of char
- character definition
2. string definition
[Use of Char]
any single letter, digit or number
Character definition
[Use of Char]
- collection of characters
- preceded by “*” or followed by integer value enclosed with “[]”
String definition
30 char
char name[31]
why is it 31?
String terminator for the extra space!