Condition Components

 


What basic ideas underlie a structured conditional statement?

C example

        if ( a > b )
        {
            do_something();
            do_anotherThing();
            do_aThirdThing();
        }
        else
        {
            do_somethingElse();
            do_anotherOtherThing();
        }

What about loops?

C example

        while ( a > b )
        {
            do_something();
            do_anotherThing();
            do_aThirdThing();
        }

        /* Code after loop */

 

But assembly languages don't have blocks!

 


Alyce Brady, Kalamazoo College