//Sample Program to test the Break keyword
#include < iostream.h >
#include < conio.h >
void main()
{
int i,num,flg=0;
clrscr();
for (i = 0; i < 5; ++i)
    {
cout << "\n Please enter a number: ";
cin >> num;
if (num==13)
{flg=1;
break;
}

cout << "\n Not your lucky number \n ";
   }
if (flg==1) cout << "\n You entered your lucky number at " << "attempt "<< i+1;
getch();
}
<< GO BACK

Our aim is to provide information to the knowledge seekers. 


comments powered by Disqus






Footer1