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.
Review the options below to login to check your access.
Log in with your Cambridge Aspire website account to check access.
If you believe you should have access to this content, please contact your institutional librarian or consult our FAQ page for further information about accessing our content.