ASSIGNMENT
for the complete fulfillment of the requirements for the lab course of
Fundamentals of Computer Programming
Submitted by
HARIS SHAH SYED | CMS ID
Instructor
MR SAAD ALVI
Lab Engineer, Department of Computer Science, National University of Sciences & Technology,
Baluchistan Campus (NBC), Quetta.
IDENTIFIERS
Identifiers are names for entities in a C program, such as variables, arrays, functions, structures,
unions and labels. An identifier can be only of uppercase, lowercase letters, underscore and
digits, but should start only with underscore or an alphabet. The word C cannot be used. It is
called internal if the identifier is not used in external link process. Example: Local variable. If the
identifier is used in an external link process, then it is called as external.
SYNTAX FOR NAMING IDENTIFIERS
A valid identifier can have letters (both uppercase and lowercase letters), digits and
underscores.
The first letter of an identifier should be either a letter or an underscore.
You cannot use keywords as identifiers.
There is no rule on how long an identifier can be. However, you may run into problems in some
compilers if the identifier is longer than 31 characters.
Differentiate between Syntax and Semantics of a
programming language.
Semantics describe the logical entities of a programming language and their interactions.
Syntax defines how these are expressed in characters.
For example, the concept of pointer arithmetic is part of C's semantics; the way the + and -
operators can be used to express pointer operations are part of its syntax.
Sometimes, two languages share part of their semantics, but the syntax differs wildly (e.g. C#
and [Link] - both use value types and reference types, but the characters you type to define
them are different); in other cases, two languages are syntactically similar.