Pages

Wednesday, 21 February 2018

While Loop Example in C++ Programming Language

While Loop Example in C++ Programming Language
#include <iostream>
using namespace std;
int main(){
   int i=1;
   /* The loop would continue to print
    * the value of i until the given condition
    * i<=6 returns false.
    */
   while(i<=6){
      cout<<"Value of variable i is: "<<i<<endl; i++;
   }

}