Chapter 2
Chapter 2
PROPRIETARY MATERIAL © 2016 The McGraw Hill Education, Inc. All rights reserved. No part of this PowerPoint slide may be displayed, reproduced
or distributed in any form or by any means, without the prior written permission of the publisher, or used beyond the limited distribution to teachers and
educators permitted by McGraw Hill for their individual course preparation. If you are a student using this PowerPoint slide, you are using it without
permission.
• A programming language is designed to help process certain
kinds of data consisting of numbers, characters and strings
and to provide useful output known as information.
• The task of processing of data is accomplished by executing a
sequence of precise instructions called a program.
• The instructions are formed using certain symbols and words
according to some rigid rules known as syntax rules (or
grammar).
C TOKENS
• In a passage of text, individual words and punctuation marks are called
tokens.
• Similarly in a C program, the smallest individual units are known as C
tokens.
IDENTIFIERS
• Identifiers refer to the name of variables, functions and arrays.
• These are user-defined names and consists of a sequence of letters and digits.
• Rules for identifiers:-
1) First alphabet must be an alphabet (or underscore)
2) Must consists of only letters, digits or underscore.
3) Only first 31 characters are significant.
4) Cannot use a keyword.
5) Must not contain white space.
CONSTANTS
• Constants in C refer to fixed values that do not change during the
execution of a program.
• Value of variable on the left of equal sign is set equal to the value of
quantity (or expression) on the right.
e.g. year = year +1;
• During assignment operation, C converts the type of value on RHS to the
type on the LHS.