O'Reilly logo

C Primer Plus, Fourth Edition by Stephen Prata

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programming Exercises

Reading about C isn't enough. You should try writing one or two simple programs to see if writing a program goes as smoothly as it looks in this chapter. A few suggestions follow, but you should also try to think up some problems yourself. You'll find answers to selected programming exercises on the publisher's Web site.

  1. Write a program that uses one printf() call to print your first name and last name on one line, uses a second printf() call to print your first and last name on two separate lines, and uses a pair of printf() calls to print your first and last name on one line. The output should look like this (but using your name):

    Anton Bruckner ← First print statement
    Anton ← Second print statement
    Bruckner ← Still the second ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required