Block diagram reduction techniques in control systems.ppt
Fundamental of C Programming (Data Types)
1. Fundamental of C Programming
(Data Types)
Submitted By:
Engr. Jimmy Majumder
cover
Computer Basic and Programming
2. 1
Block Diagram
Data types specify how we enter data into our programs and what
type of data we enter. C language has some predefined set of data
types to handle various kinds of data that we can use in our program.
These datatypes have different storage capacities.
3. 2
Primitive Data Types in C
In computer science, a primitive is a fundamental data type
that cannot be broken down into a more simple data type.
1. character(char) : a character is a single visual object used to represent text, numbers,
or symbols. Here, the letter "A" is a single character. With a computer, one character
is equal to one byte, which is 8 bits.
2. integer(int): An integer is a datum of integral data type, Integral data types may be of
different sizes and may or may not be allowed to contain negative values.
3. floating point(float): This data type built into the compiler that's used to define
numeric values with floating decimal points. The float data type stores double-
precision floating-point numbers with up to 17 significant digits. FLOAT corresponds to
IEEE 4-byte floating-point, and to the double data type in C.
4. double : The double data type is also numeric values, double-precision 64-bit IEEE
754 floating point. Its range of values is beyond the scope of this discussion, but is
specified in the Floating-Point Types,
5. void: void is used as a function return type, it indicates that the function does not
return a value.
4. 3
Derivied Data Types in C
In computer science, those data types which are derived
from the fundamental data types are called derived data
types.
1. array : An array is a collection of data items, all of the same type, accessed
using a common name. A one-dimensional array is like a list; A two
dimensional array is like a table; The C language places no limits on the
number of dimensions in an array, though specific implementations may.
2. pointer: A pointer is a variable whose value is the address of another
variable, i.e., direct address of the memory location. Like any variable or
constant, you must declare a pointer before using it to store any variable
address.
1. function: A function is a block of statements that performs a specific task.
Let's say you are writing a C program and you need to perform a same task in
that program more than once. In such case you have two options: a) Use the
same set of statements every time you want to perform the task.
5. 4
User Defined Data Types in C
In computer science, Those data types which are defined by the
user as per his/her will are called user-defined data types.
Examples of such data types are structure, union and
enumeration.
1. enum : An enumerated type (also called enumeration, enum, or factor in the
R programming language, and a categorical variable in statistics) is a data type
consisting of a set of named values called elements, members, enumeral, or
enumerators of the type.
2. Structure: A structure creates a data type that can be used to group items of
possibly different types into a single type.
3. union: A union is a special data type available in C that allows to store
different data types in the same memory location. You can define a union
with many members, but only one member can contain a value at any given
time. Unions provide an efficient way of using the same memory location for
multiple-purpose.
6. 5
Data Types Summary in C
A code has developed using a code compiler software
Thank You !