loop_for_while1

Code used :

#include <iostream>
using namespace std;
//compare_for_while_loop1.cpp
int main ()
{
 int j=0;int i =0;
  ///
 cout << " for loop " <<endl;
  for(i; i<=10;i++)
        {
      cout <<  i << " s " ;
      if(i % 2){ continue;}
        cout <<  i << " e " ;
        }
//
  cout <<endl;
  cout << " while loop " <<endl;
    while(j <=10)
    {
        cout << j << " s ";
        j++;
        if(j% 2){ continue;}
       cout << j << " e ";
    }//
     cout <<endl;

			
  return 0;
}
 
for : loop terminates after completing 10 rounds, while loop erminates as the value hits 10