Loops - Continue/Break Statement

This section contains source codes of many Programs that are the Basics of Programming in C++.

Loops - Continue/Break Statement

Postby MT Shahzad on March 3rd, 2008, 5:51 pm

Some c++ programs showing the use of Loop statements like while-loop, do-while-loop and for-loop.

CPP-015: A C++ Program that prints the first 10 integers. [ using for loop ]
CPP-016: A C++ Program that prints odd numbers form 0 to 50. [ Using for Loop ]
CPP-017: A C++ Program that reads a number, coumputes and displays its factorial. [ using for loop ]

CPP-018: A C++ Program to print a histogram in the following patterns.
* **********
** *********
*** ********
**** *******
***** ******
****** *****
******* ****
******** ***
********* **
********** *
[ using nested for loop ]

CPP-019: A C++ Program to print a diamond. [ using nested for loop ]

CPP-020: A C++ Program to print a histogram in the following pattern.
**********
**********
**********
**********
**********
[ using nested for loop ]

CPP-021: A C++ Program that computes and display the sum of first ten integers. [ using for loop ]
CPP-022: A C++ Program that computes and display the square of first ten integers. [ using for loop ]
CPP-023: A C++ Program that prints first 20 integers. [ using while loop ]
CPP-024: A C++ Program that prints first 20 integers in reverse order. [ using while loop ]

CPP-025: A C++ Program that prints (a) All the odd numbers between 0 to 50, (b) All the even numbers between 0 to 50, (c) All the numbers that are divisible by 5 between 0 to 50. [ using while loop ]

CPP-026: A C++ Program that reads a number, coumputes and displays its factorial. [ using while loop ]
CPP-027: A C++ Program that reads a number and displays it with its digits in reverse order. [ using while loop ]
CPP-028: A C++ Program that reads a number and displays it with its digits in reverse order. [ using do-while loop ]
CPP-029: A C++ Program that reads a number,coumputes and displays its factorial. [ using do-while loop ]
CPP-030: A C++ Program that prints all the even numbers between 0 to 50. [ using while, do-while and for loop ]
CPP-031: A C++ Program to illustrate the use of the break statement.
CPP-032: A C++ Program to illustrate the use of the continue statement.
You do not have the required permissions to view the files attached to this post.
MT Shahzad
Web/Software Developer
http://mts.sw3solutions.com
User avatar
MT Shahzad
Site Admin
 
Posts: 300
Joined: February 29th, 2008, 8:11 am
Location: Muridke, Pakistan

Return to Basic Programming

Who is online

Users browsing this forum: No registered users and 0 guests