Solution for Exercise 11-1

ex1101

#include <stdio.h>

int main()
{
    int x;

    for(x=0;x<10;x++)
        puts("Get off my lawn you kids!");
    return(0);
}

Notes

* You don't have to use the variable x as I did; any int variable would do.

* The ++ increment operator appears at Line 7. That for statement is very similar to the for loop example shown in the book, although here you're only repeating the loop ten times, not 100.

* The curly brackets around the puts() statement are optional. I've omitted them above.