Sunday 24 June 2012

Lecture: 101


                                                Lecture 101

//Break while loop
#include <iostream>
#include <conio.h>
using namespace std;
 main ()
{  
   int i; 
   i=1;
   while(i<10)
   {
       if(i==5) break;         
    cout<<i<<" ";
    i++;
   }        
  getch();
  return 0;
}

Code view in dev compiler:

Compile the program Ctrl+F9

      Run program Ctrl+F10