Check out example codes for "c while". It will help you in understanding the concepts better.

Code Example 1

while( a < 20 ) {
      printf("value of a: %d\n", a);
      a++;
   }

Code Example 2

while (testExpression) 
{
    // statements inside the body of the loop 
}

Code Example 3

int i=0;
while(1){
  // Process you want to loop
  i++;
  if(i>10){
    break;
  }
}

Learn ReactJs, React Native from akashmittal.com