format string:
- %.5f presicion 5 decimal place
- %9.5f field width 9 character
- %e show in exponent form
- NOT !
- AND &&
- OR ||
== means comparing between the 2 value
= means assigning some value to the variable
Chapter 4
Terms
- Classical waterfall model-----RDCTDM--requirement, design, code, testing, documentation,maintainance
- Algorithm
- Pseudocode
- Flowchart
- Control structure in C
- Sequence structure
- Selection structure
- Repetition structure
Selection structure
- If.. else
- if(condition)statement true; else{ statement false}
- using ternery operator||(condition? statement true:statement false)
- switch(control expression){
action; break means come out of loop
break;
.............
...............
.............
default:
action;
break;
}
notes..
getchar()>>>>>>>>> get 1 character from keyboard
Repetition structure
1.While
while(condition) in while there is no ; beside condition
{ body}
2. do..while
do{
statement;}
while(condition);
3. for
for(initialization; loop continuation test; counter)
{
use comma for many initialization
} initialize then test do the statement only the increase counter and check again
Function
usefull library function
- stdlib.h
- math.h
- ctype.h
- string.h
return_data_type function function_name(parameter list)
{ **** can only return 1 item
declaration
statement
}
Function prototype
return-data-type function name(parameter-list);
- required only when function definition comes after use in program
- no need variable name
same as function prototype but supply with real parameter
2 way to call function
- call by reference
- call by value
No comments:
Post a Comment