computer programming
1. How is control flow used to solve problems using computer programming?
control flow structures are statements that are used to regulate how data is handled. you have two basic control flow structures: loop(while) and conditional(if and else). a combination of this two would solve any problem. say you are searching for an element in a list:
Array list[];
object x; //what you are searching for
number ctr=0;
boolean notFound=true;
while(notFound){
if(list[ctr]=object){
notFound=false;
}
}
that is a very simple case though.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment