Solution for Exercise 9-10

ex0910

#include <stdio.h>

int main()
{
    char alphabet;

    for(alphabet='z';alphabet>='a';alphabet=alphabet-1)
    {
        printf("%c",alphabet);
    }
    putchar('\n');
    return(0);
}

Notes

* The changes from Listing 9-4 in the book all take place at Line 7. The 'A' is changed to 'z' and the 'Z' is changed to 'a'. Also, the third part of the for statement decrements (subtracts one from) the value of variable alphabet.