Language C Basics
Language C Basics
Language C Basics
What is Language?
Language is a medium of communication. There are several types of languages like:
1. Low Level Language: - Low level language is used to design system software and
utilities etc.
2. High Level Language: -High level language is used to design the application software
like Business Problems and Scientific problem.
What is C?
C is a programming language developed at AT & T’s Bell Laboratories of USA in 1972. It
was designed and written by a man named Denis Ritchie. The C Compilers combines the
capabilities of an assembly language with the feature of a high-level language and therefore it
is well suited for writing both system software and business package.
There are only 32 keywords and its strength lies its built-in functions.
Constants
Constant in C refer to fixed value that do not change during the execution of a program. This
quantity can be stored at a location in the memory of the computer.
Types of C Constants
C constants can be divided into two major categories:
1. Primary Constants
a) Integer Constants
b) Real Constants
c) Character Constants
2. Secondary Constants
a) Array
b) Pointer
c) Structure
d) Union etc.
Rules for Constructing Integer Constants
a) An integer constant must have at least one digit.
b) It must not have a decimal point.
c) It could be either positive or negative.
d) No commas or blanks are allowed within an integer constant.
e) The allowable range for integer constants is -32768 to +32767.
Rules for Constructing Real Constants
a) An integer constant must have at least one digit.
b) It must have a decimal point.
c) It could be either positive or negative.
d) No commas or blanks are allowed within an integer constant.
Rules for Constructing Character Constants
a) A character constant is a single alphabet, a single digit or a single special symbol
enclosed within single inverted commas; both the inverted commas should point to
the left.
b) The maximum length of a character can be 1 character.
Variables
In C a quantity which may vary during program execution is called a variable. Variable
names are given to locations in the memory of computer where different constants are stored.
These locations can store integer, real or character constants.
Rules for Constructing Variable Names
a) A variable name is any combination of 1 to 8 alphabets, digits or underscores. Some
compilers allow variable names whose length could be up to 40 characters, still, it
would be safer to stick to the rule of 8 characters.
b) The first character in the variable name must be an alphabet.
c) No commas or blanks are allowed within a variable name.
d) No special symbol other that an underscore can be used in a variable name.
C Keywords
Every C word is classified as either a keyword or an identifier. All keywords have fixed
meanings and these meaning cannot be changed. Keywords serve basic building blocks for
program statements.
There are 32 Keywords available in C.