Tuesday, 5 September 2017

DATA TYPES IN C

DATA TYPES IN C

Data Types are used to declare a variables or functions of different types. The variables are use to store the data. The datatypes are to see how much data will occupies in storage There are 4 data types in c

  • INT 
  • FLOAT
  • CHAR
  • DOUBLE

  • 1) Int: integers are the whole numbers that have positive and negative values and no decimal values  ex:1,-3,0
  • int is also a keyword in c to declare the variables  
  • ex: int a;
  • here a is a variable 
  • The size of int is 2 bytes in (32 bit ) 4 bytes in (64 bit) operating systems
  • The range of integer data type is -32,768 to 32,767
2)  Float: Float variables can hold fractional and real numbers such as 23.54,58.2.
we can use a keyword float to declare the fractional values in c
ex: float bill;
here float is a keyword and bill is variable.
The size of float data type is 4 bytes. its range is1.2E-38 to 3.4E+38
  
3) char: Char is a datatype to use to declare character data
ex:char name=k ;
here name is a variable and the value of name is k.
The size of char data type is 1 byte.

4) double:
The size of (Double precision data type) is 8 bytes.
The keyword double is used to declare the real numbers 
ex:double book price; 
The range is 1.7E-308 to 1.7e +308

No comments:

Post a Comment

OPERATERS

"Don't Review Skip": Fans Troll Tim Paine For Poor DRS Challenge On Day 3

India vs Australia: Tim Paine was again in the firing line as his poor DRS call against Mayank Agarwal cost Australia a review on Day 3 of t...