144 terms

ANSI C 1-7

for midterm IC KMITL SE6 2014
STUDY
PLAY
flow of control
the order in which a program's statements are excuted
sequential
means that statements are executed in sequence.(Done in the main function)
selection
is used to select which statements are to be performed next based on a condition being true or false(done using if-else conditional statements)
repetition
used to repeat a set of statements
invocation
invoking a sequence of instruction using a single statements
if (condition)
statements that are executed if condition is true
relational expression
consist of relation operator that compare two operands
relational operator
shows the relationship between two operands
short circuit evaluation
whenever the truth or falsity of an expression containing any logical operators is definitely determined,evaluation stops,regardless of how many additional operations may exists
one way if statement
simplest C selection statement
compound statement
one or more statements contained between braces
nested if statement
one or more if-else statements within an if or if-else statement
if else chain
if statement following by else if statements and ending with an else statement
switch
switch statement is a specialized selection statement that can be used in place of an if-else chain where exactly equality to one or more integer constants is required
case
compares the values that will be compared
default
operates the same as the last else statements;default is optional
break
identifies the end of a particular case
defensive programming
the program includes code to check for improper data before an attempt is made to process it further
input data validation
checking user input data for erroneous or unreasonable data
compile time error
errors detected by the compiler aka.syntax error or parse error
run time error
error that occur while the program is running
desk checking
the method for detecting errors before a program is compiled
program testing
the method for detecting errors wither while the program is executing or after it has excuted
compile time and run time
distinguish between errors based on when the error is detected
typographical error
spelling errors
logic error
can either cause a run-time error or produce incorrect results-are characterized by erroneous,unexpected,or unintentional output
program tracing
imitate the computer and execute each statement by hand
diagnostic printf()
include the printf() function in the program to display the value of selected variables
echo printing
add temporary code that displays the variable of all input date to check the input recevied
debugger
a program that controls the execution of a C program,can interpret the C program at any point in its execution and can display the values of all variables at the point of interruption
loop
the section of code that is repeated each repetition to as an iteration or pass through the loop
pretest loop
the case where the test occurs at the beginning of the loop before any statement within the loop is executed
entrance controlled loop
pretest loop
posttest loop
a loop that evaluates a condition at the end of the repeating section of the code aka.Exit-controlled loop
fixed count loop
aka.Counter-controlled loop-the condition is used to keep track of the number repetitions that have occured
program loop
the transfer of control back to the start of a while statement to reevaluate the expression
sentinel
data values used to signal either the start or the end of data series
EOF
End of file-signals the compiler to stop the loop
null statement
A semicolon with noting preceding it;is also a statement Ex.for(;count<=20)
comma separated list
list in C,where commas are required to separate individual expressions in the lists.Ex.for(c=1;c<=9;printf("%d",c)c+=2);
nested loop
a loop contained within another loop
outer loop
the first loop that controlled the inner one
inner loop
the second loop that is within the outer loop
called function
the function that is called into action
calling function
the function that does the calling
function prototype
declaration statement for a function
argument
items enclosed within the parentheses in the call statement aka.Actual arguments and actual parameters
pass by value (call by value)
the value of the variables are passed into the called function for each argument
function header
first line of the function that tells the name of the function,return type value,and parameters
function body
it operate on the passed data and return at most one value back to the calling function
parameter
argument names in the header line aka.('formal parameters' and 'formal arguments')
stub
a fake function/the beginning of a final function that is used as a placeholder for the final function until the function is completed
random number
a series of number whose order cannot be predicted
scaling
the method for adjusting the random numbers produced by a random-number generator to reside within a specified range
lifetime
the length of time that storage locations are reserved for a variable
pseudorandom number
numbers that are sufficiently random for the task
hardware
components used to make a computer
byte
grouping of 8 bits to form a larger unit
character code
collection of patterns consisting of 0s and 1s used to represent letters, single digits, and other single characters
main memory unit
stores data and instructions as sequence of bytes
RAM
(Random Access Memory) where every part can be accessed randomly and it is volatile
volatile
data is lost whenever power is turned off
ROM
(Read Only Memory) nonvolatile and contains fundamental instructions necessary for starting the com when power is turned on
CPU
(Central Processing Unit) consist of control unit and ALU. Control unit directs and monitors overall operation of the computer, constructed as a single microchip called a microprocessor
ALU
(Arithmetic and Logic Unit) performs all computations
control unit
directs and monitors the overall operation of the computer
microprocessor
a single microchip (CPU)
executable program
programs that can operate a computer, which are written by machine language (binary numbers)
machine language
computer's internal language
opcode
(operation code) tells the computer the operation to be performed
source code
(source program) programs written in a computer language
standard library
files that store set of functions
identifier
words that have meaning to the compiler; consists of reserved words, standard identifiers, and programmer-created identifiers
reserved word
(key word) a word that is predefined by the language for a special purpose
standard identifier
words that are predefined in C; most are name of functions e.g. abs,printf,scanf
driver function
(main function) tells the other functions in what sequence they will operate
function header line
the first line of a function and contains 1.type of return value 2.function name 3.type of data sent into function
argument of a function
data transmitted or passed into a function and is placed within the function name parentheses
executable statement
statements that cause some specific action to be performed by the computer when the function is executed and ends it a (;)
comment
a note within /........./ that tells about the code. Comments can not be NESTED
header file
file that is placed at the top of a C program using #include command e.g.stdio.h,math.h
preprocessor command
begins with # and performs some action before the compiler translates the source program; e.g. #include<stdio.h>
calling a function
(invoking a function) the function has arguments passed into it and is executed
string
messages; a sequence of characters
newline (escape sequence)
(\n) tells printf() to start on a newline
syntax
set of rules for formulating statements that are "grammatically correct" for the language
white space
any combination of one or more blank spaces, tabs, or new lines
data type
set of values and a set of operations that can be apply to these values e.g. float,int,char,double
built in datatype
(primitive type) is provided as an integral part of the language
literal value
an acceptable value for a data type; they literally display their values
integer
(int): whole numbers
char
(character): stores individual characters (ASCII) e.g.'A','$','b','!',etc.
escape character
the backslash (\): the compiler escapes from the normal way the characters would be interpreted
escape sequence
the combination of a backslash and these specific characters
floating point value
(real number): any number that contains a decimal point
float
(single-precision)
double
(double-precision)
precision
typically refers to numerical accuracy
arithmetic operator
operators used for arithmetic operations
binary operator
requires two operands
operand
a literal value or an identifier that has a value associated with it
conversion control sequence
(conversion specification/formal specifier) tells the function printf() what type of value is to be displayed; e.g. %d,%.2f,%5.2f
control string
a string that contains a conversion control sequence
unary operator
has only 1 operand, negation
expression
any combination of operators and operands that can be evaluated to a yield value
integer expression
contains only integers
floating point expression
contains only floats
mixed mode expression
an expression that contains both integers and floats; if both are int, result is an int. if one operand is real result is double precision
variable
names given by programmers to computer storage
unsigned datatype
provides only for nonnegative(0 and positive values)
signed datatype
short int,int,and long int
qualifier
keyword short, long, and unsigned are qualifiers because they qualify the meaning of the keyword int
variable address
the addresses of the first memory byte used for storing the variable
assignment operator
(=) has the lowest level of precedence and has right-to-left associativity
definition statement
define or tell the compiler how much memory is needed for data storage
initialization
when a declaration statement provides an initial value
implicit type conversion
the automatic conversion across an assignment operator
explicit type conversion
user-specified conversion using cast operators
cast (operator)
the operator used to force the conversion of a value to another type
increment operator
(++) the variable is increased by 1;prefix increment operator(++n), postfix increment operator(n++)
garbage value
a previously stored number, if it has not been initialised to a specific known value
counting statement
a special type of assignment statement, similar to the accumulation statement
decrement operator
(--) the variable decreased by 1;prefix decrement operator(--n),postfix decrement operator(n--)
user input validation
handling invalid input
robust program
programs that detect and respond effectively to user input
literal data
(literal) any data within a program that explicitly identifies itself
magic number
literal values that appear many times in the same program
named constant
(symbolic name,symbolic constants) a name given to a magic number using the #define tax 0.05
local variable
variables created inside a function; are available only to the function itself and are local to the function
scope
the section of the program where the variable is valid or 'known'
global variable
a variable whose storage has been created for it by a declaration statement located outside any function and can be used by all function
storage class
determines where and how long a variable's storage locations are kept before they are released: auto,static,extern,register
automatic
storage class when automatic local variables is automatically reserved. lifetime = end of calling
static
storage class for a variable that is initialised once. lifetime = program
run time initialisation
an automatic declaration statement. Where initialisation occurs each time the declaration statement is encountered
extern
storage class which extends the scope of a global variable declared in one source code file into another source code file
register
storage class for high speed storage area where the can be accessed faster than the normal memory storage areas
pass by reference
passing an address into a function; the function can reference or access the variable using the passed address
pointer variable
a variable that can store an address or pointers
indirection operator
() used to store an address. num means the variable whose address is stored in.
indirect addressing
when using a pointer, the value that is obtained is always found by first going to the pointer for an address
direct recursion
(self-referential) when a function invokes itself
indirect recursion
(mutual recursion) when a function invoke a second function which in turn invokes the first function
stack
an area of memory used for rapidly storing and retrieving data
YOU MIGHT ALSO LIKE...