Thursday 5 January 2017

Fundamental Data types

Share & Comment
Fundamental data types are those that are not composed of other data types.

Five fundamental data types are as follows

  • INT DATA TYPE
  • CHAR DATA TYPE
  • FLOAT DATA TYPE
  • DOUBLE DATA TYPE
  • VOID DATA TYPE


INT DATA TYPE

Integer are whole numbers such as 5 , 39, -1917, 0 etc. They have no fractional parts. Integers are represented in C++ by int data type. An identifier declared as int becomes an integer variable and can hold integer values only.

CHAR DATA TYPE

Characters can store any number of the C++ implementations basic character set. If a character from this set is stored in a character variable, its value is equivalent to the integer code of that character. AN identifier declared as Char becomes a character variable.

Char type is often said to be an integer type. It’s is said so because letters, symbols etc. are represented in memory by associate number code which are integer only.

FLOAT DATA TYPE

A number having fractional part is a floating point number. For example 3.14159 is a floating-point number. The decimal point signals that it is a floating-point number not and integer. The number 12 is an integer, but 12.0 Is a floating-point number.

Floating point numbers can also be written as exponent notation, for example 147.9101 can be written as 1.479101E02.

DOUBLE DATA TYPE

The data type double is also used for handling floating-point numbers. But it is treated as distinct data type because, it (double data type) occupies twice as much memory as type float, and stores floating-point numbers with much larger range and precision. Its stands for double precision floating-point.

VOID DATA TYPE

The void type specifies an empty set of values. It is used as the return type for functions that do not return a value. No object of type void may be declared.


  
Tags:

Written by

Hy, i am a Code Geek ! And like to eduate others.

0 comments:

Post a Comment

 
Copyright © C++ Programming | Designed by Templateism.com