BASIC DATA TYPES IN C

In this blog
Basic data types
                   A simple eg                          
             small expl about void   





Types of data type...


1.) Basic data  type

2.) Derived data type

3.) Enumerated data type

Basic data types

there are 5 basic data types in c 

Data typekeyword usedSize in bytesRangeFormat specifier
    Characterchar1-128 to 127%c
   Integerint4-2,147,483,648 to 2,147,483,647%d
    Floating pointfloat43.4E-38 to 3.4+38%f
Double        double          8              1.7E-308 to 1.7+308           %lf
   Valueless     void           0          Value less          ~~
 


leaving this we are having many more data types with extensions :

1) unsigned        ( +ve  range only)
2) signed            ( both +ve and -ve range)
3) long                ( extended range )
4) short               ( short range)


so what is the use of this extensions , usage are based on requirement ,for eg  you want to store interger type of data but you dont need that much of space as that for basic integer so you can use short extension  in order to save some space. to read more go to  

so lets take an eg which would include  keyword used ,size in bytes ,Range and format specifier.

eg 


(if you dont know about the scanf and printf ,they are just used for scaning the value from the user and printing the value on screen respectively,dont wory i will discuss that in later)

(note : format specifier %d in this case, will change according to the datatype,and the value 2 in this case  should not be greater than range otherwise garbage value will gets diplayed)


(if you wanna know about the ranges then go to  )

explanation about void

void is data type mainly used for functions and pointer but not with variable (to know more about go to 
)
(we will discuss that whole concept late on because it is out of range of our topic)




(leave the comment down below if you have a doubt or suggestions ,thnks🙂)
                            

No comments:

Post a Comment

Contact Form

Name

Email *

Message *