O'Reilly logo

Learn to Program with C by Noel Kalicharan

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

CHAPTER 3

image

Programs with Sequence Logic

In this chapter, we will explain the following:

  • The idea of reading data supplied by a user
  • How the scanf statement works
  • How to read numeric data using scanf
  • How to read string data using gets
  • Important principles of program writing using several examples

3.1 Introduction

In the last chapter, we introduced some of C’s basic data types—int, double, and float—and used simple statements to illustrate their use. We now go a step further and introduce several programming concepts by writing programs using these types.

The programs in this chapter will be based on sequence logic—that simply means the statements ...

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