Professional Documents
Culture Documents
17-06-2021
17-06-2021
DATA TYPES:
The type of the data that we want to store in C Program is specified by Datatype.
C Language has 4 different Data types. They are;
1) Basic/Primary/Fundamental/Intrinsic/Implicit/Internal/Built-In Data Types
2) Derived/Secondary Data Types
3) User-Defined Data Types
4) Void Data Type
Variables:
A variable is a memory place to store a value.
Syntax:
datatype variablename = value;
Examples:
1)
int total = 850;
“total” is a variable in example 1.
“total” can store only integer type number.
2)
float avg = 77.32;
“avg” is a variable in example 2.
“avg” can store only real type number.
3)
char ch = ‘G’;
“ch” is a variable in example 3.
“ch” can store only character type data.
Characters that are to be stored in C program must always enclosed in single quotes.