Continue and do-while In C Language

When continue is encountered inside any loop, control automatically passes to the beginning of the loop. A continue is usually associated with an if.

Example :

main( )

{

int i, j ;

for ( i = 1 ; i <= 2 ; i++ ) { for ( j = 1 ; j <= 2 ; j++ ) { if ( i == j ) continue ; printf ( "\n%d %d\n", i, j ) ; } } } The output of the above program would be... 1 2 2 1 The continue statement takes the control to the for loop (inner) bypassing rest of the statements pending execution in the for loop (inner). The do-while Loop

The do-while loop looks like this:

do
{
this ;
and this ;
and this ;
and this ;
} while ( this condition is true ) ;

The difference between the working of while and do-while loops. This difference is the place where the condition is tested. The while tests the condition before executing any of the statements within the while loop. As against this, the do-while tests the condition after having executed the statements within the loop.

This means that do-while would execute its statements at least once, even if the condition fails for the first time. The while, on the other hand will not execute its statements if the condition fails for the first time.
The previous post of the blog deals with Requirements testing technique.

UNIT TESTING

UNIT TESTING PART ONE

UNIT TESTING PART TWO

UNIT TESTING PART THREE

GUI TESTING

WINDOWS COMPLIANCE GUI TESTING PART ONE

WINDOWS COMPLIANCE GUI TESTING PART TWO

WINDOWS COMPLIANCE GUI TESTING PART THREE

WINDOWS COMPLIANCE GUI TESTING PART FOUR VALIDATION TESTING

WINDOWS COMPLIANCE GUI TESTING PART FIVE CONDITION TESTING

WINDOWS COMPLIANCE GUI TESTING PART SIX GENERAL CONDITION TESTING

No comments:

Post a Comment