Friday, August 7, 2009

Loops statements

Any programming language generallywill be having certain tools through which a user can perform repetative actions and as well as for decision making.C++ of course provides such tools ,indeed it uses the same for loops while loops,d0 while loops,if statements and switches that regular Cemployes.
Circumstances often call upon program repetative tasks.
here is the syntax one of the looping statement
FOR(intialization,text-expression,update expression)
body
c++ syntaz counts a complete for statement as a single statement even though it may in corporate one or more statements in the body portion.C++allowes the declaration of the variable in the for loop it self which is not possible in C
The useual parts of a for loop handle these steps
1.Setting the value initially
2.Performing a test to see if the loop should continue
3.Executing the loop actions
4.updating the values used for the post.

No comments:

Post a Comment