Fundamentals of C
Fundamentals of C
Fundamentals of C
C Programming
C Fundamentals and
Data Types
Learning Objectives:
At the end of the session, students should be
able to:
1. Identify the program structure of C
programming language
2. Enumerate keywords in C
3. Enumerate data types in C
Important Features of C Language
Integer - int
Floating point - float
Double floating point - double
Character - char
Variable Declarations
Assigning an identifier to data type is called type
declaration. In other words, a declaration associates a
group of variables with a specific data types. All variables
must be declared before they appear in executable
statements. The syntax of variable declaration and some
examples are given below.
Syntax :
Data type „variable‟
For example:
int a;
float c;
char name;
double count;
Variable Declarations
If two are more variables of the same data type has to be declared they can
be clubbed as shown in example given below.
short int a, b, c ;
long int r, s, t ;
The above declarations cab also be written as :
short a, b, c;
long r, s, r;
Assigning Values to Variables
For example:
const int tax_rate = 0.30;