C and C++ Programming Resources | C & C++ Code Example Index

 

 

 

 

The C++ Program Controls: Repetition/loop, Selection/conditional Sample Codes Index Page

 

The following links demonstrate the C++ program examples on the C++ program controls. In general, program controls, control the flow of the program executions. Two type of the program controls are repetition and selections. These program controls make some branching in the typical program execution. The C++ program control constructs discussed include the if-else, if-else-if, for loop, do-while and switch-case-break.

 

 

C++ Program Controls: Repetition/loop, Selection/conditional

 

  1. Determining the benefits based on the job profile C++ program sample using if-else statement

  2. Determining the post promotion based on current post, year served and the number of publication in C++ using the nested if-else statement

  3. To select a proper grade for the given mark using the if-else-if statement C++ code example

  4. Printing the pyramid pattern using characters and for loop C++ code example

  5. Listing a menu selection using do-while loop C++ program example

  6. Printing characters pattern using the nested for loop C++ code sample

  7. A simple menu selection program using switch-case-break C++ code sample

  8. The multiple if-else statements for money transactions C++ code sample

 

C and C++ Programming Resources | C & C++ Code Example Index | C Code Example Index