Student Profile Sample - We help schools to connect the data they have, with ...
C Language presentation
1.
2. • It had been developed at AT&T’s (American Telephone and
Telegraph)BellLaboratories in 1972 by DennisRitchie.
• It is based on highlevel language.
3. (Smallest individual unit in a program)
Data types
Keywords
Constants
Operators
Punctuators
Variables
4. • C identifier is a name used to identify a variable, function,
or any other user-defined item .
• An identifier starts with a letter A to Z, a to z, or an
underscore followed by zero or more letters, underscores,
and digits ( 0 to 9).
• C does not allow punctuation characters such as @, $, and
% within identifiers.
• For example : move name
• Zara a_122 _tem
5. • The name should consist of only alphabets (both upper
and lower case), digits and underscore sign (_)
• First character should be an alphabet or underscore.
• The name should not be a keyword.
• The uppercase and lowercase letters are considered
different as C is case-sensitive. For example : code ,
Code and CODE are three different identifiers.
6. • The words that are reserved for doing specific tasks and
have standard , predefined meaning in C are known as
keywords.
• They are always written in lowercase.
• There are only 32 keywords in C –
• Auto break case char const
• Continue default do double
goto
• Register enum switch long for
• Return int if else
struct
• While short void extern static
7. • A data type in a programming language is a set of data
with values having predefined characteristics such as
integers and characters.
8. Data Types
Primary/ Built-in Derived/ User-defined
double
Array
Floating-
point
character
Integer
String
pointer
Structure
Function
9. • A variable is nothing but a name given to a storage area
that our programs can manipulate.
• Each variable in C has a specific type, which determines
the size and layout of the variable’s memory.
• The range of values that can be stored within that
memory and the set of operations that can applied to the
variable.
• Rules for variable naming –
• Variable name can be composed of letters, digits, and underscore
character.
• It must begin with either a letter or an underscore.
10. • A variable declaration specifies a data type and contains a list of
one or more variables of that type as follows :
• type variable_list;
• Here, “type” must be valid C data type including char, int, float,
double, or any user-defined object; and “ variable_list ” may
consist of one or more identifier names separated by commas.
• Example of valid declaration are :
int i , k;
char ch;
float salary , f;
double d;
• Variables can be initialized ( assigned an initial value) in their declaration.
type variable_name= value ;
Example :int d=3,f==6;
• A variable declaration has its meaning at the time of compilation only, the
compiler needs actual variable declaration at the time of linking the program.