Data Types used in C language

( function() {
if (window.CHITIKA === undefined) {
window.CHITIKA = { ‘units’ : [] };
};
var unit = {
‘publisher’ : ‘thumbnature’,
‘width’ : 728,
‘height’ : 90,
‘sid’ : “appstreetz chitika above – both”,
‘color_site_link’ : ‘0000CC’,
‘color_title’ : ‘0000CC’,
‘color_text’ : ‘000000’,
‘color_bg’ : ‘ffffff’,
‘font_title’ : ”,
‘font_text’ : ”,
‘impsrc’ : ‘wordpress’,
‘calltype’ : ‘async[2]’
};
var placement_id = window.CHITIKA.units.length;
window.CHITIKA.units.push(unit);
var x = “”;
document.write(x);
}());

Data Types used in C language

Data Types :-

               C language is rich in its data types. Storage representation to handle constants differ from machine to machine. ” C ” program on a 16 bit computer.

ANSI C Supports three classes of data types :-

Primary Data Types

Derived Data Types

User- Defined Data Types

Data Types used in C language

Data Types used in C language

Primary data types

Primary data types

Basic Data Types in C : –

Data Types Keyword used Size in bytes Range Use
Character char 1 -128 to 127 To store characters
Integer int 2 -32768 to 32767 To store integer numbers
Floating Point float 4 3.4 E-38 to 3.4 E +38 To store floating point numbers
Double double 8 1.7 E -308 to 1.7 E +308  To store  big floating point numbers
Value less void 0 value less ————————

 

Detailed list of Data Types : –

<td style="width: 362 le viagra en france.743px; text-align: center;”>-128 to 127

Data Type  Size in bytes  Range
char 1
unsigned char 1 0 to 255
signed char 1 -128 to 127
int 2 -32768 to 32767
unsigned int 2 0 to 65535
signed short int 2 -32768 to 32767
signed int 2 -32768 to 32767
short int 2 -32768 to 32767
long int 4 -2147483648 to 2147483647
unsigned long int 4 0 to 4294967295
signed long int 4 -2147483648 to 2147483647
float 4 3.4 E – 38 to 3.4 E + 38
double 8 1.7 E – 308 to 1.7 E + 308
long double 10 3.4 E – 4932 to 1.1 E + 4932
unsigned short int 2 0 to 65535

 

Integer  Data Types :-  

                               Integer are whole numbers with a range of values supported by a particular machine. the size of an integer that can be stored depends on the computer. It can be occupy the size in 2 bytes.  Range is -32768 to 32767.

C has three classes of integer storage

  • short int 
  • int
  • long int

Characters data types : –

A single character can be defined as ” Character data types “. Character are usually stored in 8 bits of internal storage.It can be occupy ” 1 “. Range is 0 to 255.

C has two classesnof characters :-

  • signed char
  • unsigned char

Floating point Data Types : –

                 Floating points numbers are stored in 32 bits , with 6 digits of precision.

                 Floating point numbers use the I EEE format to represent mantissa and Exponents. A floating point value in its binary form is known as a ” normalized form ” . It can be occupie the 4 bytes of memory. Range is 3.4 e – 38 to 3.4 e + 38

Double data types : –

                A Double data type number  uses 64 bits giving a precision of 14 digits . These are known as ” double precision value “. It can be occupies  8 bytes of memory. Range is 1.7 E -308 to 1.7 E + 308.

Void data types :-

The void type has no values. this is usually used to specify the types of functions.These types of functions is said to be Void , when it does not return any values to the calling functions.

Example program : –

Aim : – To write a C program that displays the size of every data types

program : –

              # include < stdio.h >

             # include < conio.h >

              main ()

               {

               print f ( ” The size of short integer is : % d “, size of (short int));

               print f ( ” The size of unsigned int  is : % d “, size of ( unsigned int ));

               print f ( ” The size of signed int is : % d “, size of ( signed int ));

               print f ( ” The size of integer is : % d “, size of (int));

               print f ( ” The size of long int is : % d “, size of (long int));

               print f ( ” The size of character is : % d “, size of (char));

               print f ( ” The size of unsigned char is : % d “, size of ( unsigned char));

               print f ( ” The size of signed char is : % d “, size of (signed char ));

               print f ( ” The size of floating point is : % d “, size of (float));

               print f ( ” The size of double number is : % d “, size of ( double));

            }

          compiling :- Ctrl +F9

          Running : – Alt + F5

         Output :-

  •             The size of short integer is : 2
  •         The size of unsigned int is : 2
  •         The size of signed int is : 2
  •         The size of  integer is : 2
  •         The size of long int is : 2
  •         The size of character is : 1
  •         The size of unsigned char is : 1
  •         The size of signed char is : 1
  •         The size of floating point is : 4
  •         The size of double number is : 8

( function() {
if (window.CHITIKA === undefined) {
window.CHITIKA = { ‘units’ : [] };
};
var unit = {
‘publisher’ : ‘thumbnature’,
‘width’ : 728,
‘height’ : 90,
‘sid’ : “appstreetz chitika below – both”,
‘color_site_link’ : ‘0000CC’,
‘color_title’ : ‘0000CC’,
‘color_text’ : ‘000000’,
‘color_bg’ : ‘ffffff’,
‘font_title’ : ”,
‘font_text’ : ”,
‘impsrc’ : ‘wordpress’,
‘calltype’ : ‘async[2]’
};
var placement_id = window.CHITIKA.units.length;
window.CHITIKA.units.push(unit);
var x = “”;
document.write(x);
}());

Facebook Comments
Data Types used in C language
User Rating: 0 (0 votes)

Leave a Reply