// using
break within a loop
// eliminating the letter c
apstring puppy = "DipStick";
int count = -1;
while (count < 8)
{
count++;
if (puppy[count]=='c')
break;
cout << puppy[count] << "\n";
}
cout<< "Isn't this puppy a cutie!!";
|
// using continue within a loop
// eliminating the letter c
apstring puppy="DipStick";
int count = -1;
while (count < 8)
{
count++;
if ( puppy[count] =='c')
continue;
cout << puppy[count] << "\n";
}
cout<< "Isn't this puppy a cutie!!"; |