Skip to main content

Introduce and explain the basic data types

 .

Data type

Data type refers to as storage space which hold different types of values of variable during program execution. It is a storage space which hold value of variable during program execution.

Various Data type as following
  • Fundamental (Basic) Data Type
  • Derive Data Type
  • User Define Datatype

Fundamental (Basic) Data Type

Fundamental data type refers to basic data type used in c program. In this data type requires different amounts of memory and has some specific operations which can be performed over it. They are as following

1. Integer
 Integer are whole number i.e. non fractional number. Generally integer required 2 byte storage its conversion sign %d its extended types. 
  • Integer (%d)
  • Long Integer (%LD)
  • Short integer (%ld)
  • Example : int x, y;

2. Floating Point (Float)
 Floating point types are fractional number (i.e. real number) it required 4 byte storage and its conversion sign is %f. 
  •  Float (%f) 4 byte.
  •  Example :Temperature, Fahrenheit, salary;

3. Double Datatype
 Double precision floating point data types. It reserved 8 byte storage space and conversion sign is % lf.
  • Double (%lf) 8 byte.
  • Long Double (%LF) 10 byte.
  • Example : Double salary, bill, rate;
4. Character Datatype
 A single character can be define as characters type. It reserved 1 byte storage space & its conversion line is %C and for string is %5. 
Example : Char 'A', 'B'
                    String name [20];
                    string address [40]'

Note : In character type each character represent by ASCII (American Standard Code of Information Interchange) number internally.

5. Void Datatype
 The void datatype has no value. It is usually specify the types of function (i.e. function does not return any value). 




Comments

Popular posts from this blog

BCA mathematics -I (Unit I Set)

 .

BCA Mathematics -I (Unit I Complex Number)

 .

BCA Mathematics -I (Unit I Natural Number)

.