Data Types and Instruction in C Language



Data Type in C language






Int -data types

Integers are whole number that can have both positive and negative values but no decimal values.
for example -- 0, -3, 10

In c keyword int is used for declaring integer variable. for example-- int a;

Here, a is a variable of type integer.

You can declare multiple variable at once in C. For example -- int a, b, c;

The size of int is either 2 bytes or 4 bytes. If you consider an integer having size of 4 byte(equal to 32
bits), it can take 232

Similarly, int of 2 bytes, it can take 216 


Float - data type

Float type variables can hold real numbers such as: 2.34, -9.3 etc. You can declare a decimal variable in C by using either float or double keyword. for example:

float amount; or double amount ;

Difference between float and double: The size of float (single precision float type)is 4 bytes and double(double precision float type) is 8 bytes.


Char - Character types

Keyword char is used for declaring character type variables. for example:


char ch= 'a';

Here, ch is character variable. The value of ch is 'a'. And size of character variable is 1 byte.


INSTRUCTIONS






DATA TYPE DECLARATION INSTRUCTION

                                                  (As we discuss in previous lecture)






if this article is helpful to you then please like share...


Comments

Popular posts from this blog

Important Announcements(download all my book free)

O LEVEL- INTERNET TECHNOLOGY & WEB DESIGN

Call by Reference with Pointer in C Language part-4-a