-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy path01-datatypes.c
More file actions
34 lines (27 loc) · 875 Bytes
/
01-datatypes.c
File metadata and controls
34 lines (27 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// What is datatype?
/*
A data type, in programming, is a classification
that specifies which type of value a variable
has and what type of mathematical, relational or
logical operations can be applied to it without causing an error.
*/
/*
Types
1. int
Integers are whole numbers that can have both zero,
positive and negative values but no decimal values.
For example, 0, -5, 10
We can use int for declaring an integer variable.
You can declare multiple variables at once in C programming.
2. Float
Floats are used to hold decimal numbers. For example 12.3456, 14.5.
3. Double
Floats are used to hold decimal numbers. For example 12.3, 14.5.
4. char
Keyword char is used for declaring character type variables. For example, a, b.
- Constant
Are used to declare variables, that the values can't be changed in the program.
Others
short and long
signed and unsigned
*/