do... while loop in C++





Like while loop, do-while is also a iterative statement but it tests the condition at the end of the loop body.

Syntax

initialization; 
do
 { 
    body;
    updation;
 }
while(condition);   

do...while Flow Diagram


Example:

WAP to print hello 5 times using do while.
#include< iostream >
using namespace std;
int main( ) {
 int i=1;
 do  {
   cout<< i<<". Hello"<< endl;
   i++;
 }while(i<=5);
 return 0;
}
OUTPUT:
1. Hello
2. Hello
3. Hello
4. Hello
5. Hello

Next topic is Break and Continue





 
Udemy APAC

Udemy APAC







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


CONTACT DETAILS

info@prowessapps.in
(8AM to 10PM):

+91-8527238801 , +91-9451396824

© 2017, prowessapps.in, All rights reserved