While loop in C++
Similar to for Loop, while statement creates a loop that repeats until the test expression becomes false.
Syntax
intialization; while(condition) { body; updation; }
while Flow Diagram

Example:
WAP to print hello 5 times using while.#include< iostream > using namespace std; int main( ) { int i=1; while(i<=5) { cout<< i<<". Hello"<< endl; i++; } return 0; }OUTPUT:
1. Hello 2. Hello 3. Hello 4. Hello 5. Hello
Next topic is do-while loop
Online Live Training
We provide online live training on a wide range of technologies for working professionals from Corporate. We also provide training for students from all streams such as Computer Science, Information Technology, Electrical and Mechanical Engineering, MCA, BCA.
Courses Offered :
- C Programming
- C++ Programming
- Data Structure
- Core Java
- Python
- Java Script
- Advance Java (J2EE)
- Hibernate
- Spring
- Spring Boot
- Data Science
- JUnit
- TestNg
- Git
- Maven
- Automation Testing - Selenium
- API Testing
NOTE: The training is delivered in full during weekends and during the evenings during the week, depending on the schedule.
If you have any requirements, please send them to prowessapps.in@gmail.com or info@prowessapps.in
Projects For Students
Students can contact us for their projects on different technologies Core Java, Advance Java, Android etc.
Students can mail requirement at info@prowessapps.in