Do While LOops In C++


SUBMITTED BY: Nrupeshsinh

DATE: June 24, 2016, 8:23 a.m.

FORMAT: Text only

SIZE: 446 Bytes

HITS: 520

  1. #include<iostream>
  2. #include<conio.h>
  3. using namespace std;
  4. int main()
  5. {
  6. // Variable Declaration
  7. int a;
  8. // Get Input Value
  9. cout<<"Enter the Number :";
  10. cin>>a;
  11. int counter = 1;
  12. //Do while Loop Block
  13. do
  14. {
  15. cout<<"Execute Do While "<<counter<<" time"<<endl;
  16. counter++;
  17. }while (counter <= a);
  18. // Wait For Output Screen
  19. getch();
  20. return 0;
  21. }

comments powered by Disqus