Published online by Cambridge University Press: 17 July 2025
Before we write meaningful programs in C language, let us have a look at the various building block of C language. When we learn some natural language, first we learn about the alphabets, punctuation marks, etc., i.e., the symbols used in that language. Then using these symbols we learn how to construct word, sentence, etc. We follow the same strategy to learn C language. In this chapter, first we will learn about the symbols that can be used in C language. Then, step by step we will learn to construct constants, variables and will also learn about different data types. Constants and variables are the basic data objects that are manipulated in a program. Data type is the type of an object which determines the set of values it can have. These building blocks will be discussed in this chapter.
C CHARACTER SET
A character is a basic element used to construct commands and expressions. It may be any alphabet, digit or special symbol. The valid alphabets, numbers and special symbols allowed in C are followings:
CONSTANTS
A constant is an entity that does not change its value throughout the program. Constant may be of different types – integer constant, real constant, character constant, string constant, etc.
Integer Constants
An integer constant consists of one or more digits but within the range of −32768 to +32767. It is a whole number. So, it does not contain any decimal point. There should not be any spaces, commas or special characters within the digits. An integer constant may be positive or negative. But + sign is optional.
To save this book to your Kindle, first ensure no-reply@cambridge-org.demo.remotlog.com is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Find out more about the Kindle Personal Document Service.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.