Skip to main content

DATA TYPE:

DATA TYPE:


1. Data type is used to specify what type of value to be stored in a variable.
2. C language supports different types of data types.
3. The size and range of these data types may vary based on processor type and compiler.


INTEGER DATA TYPES:
                Integer data types are used to represent value without decimal point. We can represent signed values and unsigned values. In integer category we have int, short int, long int as data types. The size and range of integer data types described in below table.

                                                      TYPE                        SIZE                         RANGE
                                            
1.       short int                  8 bits / 1 byte                           -128 to +127
2.       unsigned short int   8 bits / 1 byte                              0 to 255
3.       Int                           16 bits /2 bytes                     -32768 to +32767
4.       unsigned int            16 bits /2 bytes                           0 to 65535
5.       long int                   32 bits/4 bytes              -2147483648 to +2147483647
6.       unsigned long int    32 bits/4 bytes                         0 to 4294967295

1. In unsigned integer all bit positions are used to represent data.
2. In signed integer MSB bit is used to represent the sign (+,-) of a value, remaining bits represent value.

REAL DATA TYPE:
These data types have at least one digit with a decimal point. These are also signed and unsigned. Real data types are used to represent a value in the form of MANTISSA and EXPONENT.

TYPE                                          SIZE                                     RANGE
                                           `
                   1. Float                                 32 bits / 4 bytes                   3.4E-38 to 3.4E+38
                 2. Double                             64 bits / 8 bytes                    1.7E-308 to 1.7E+308
               3. long double                     80 bits / 10 bytes                     3.4E-4932 to 1.1E+4932

1.       Float variables contains up to 6 digits of precision where as double and long double have 10 digits of precision.

CHARACTER DATA TYPE:

By using character data type we can represent single character or combination of characters called strings. Character data types are either signed or unsigned.

             TYPE                                              SIZE                                             RANGE

            1.  Char                                        8 bits / 1 byte                               -128 to +12                                2. Unsigned char                        8 bits / 1 byte                                    0 to 255

Comments

Post a Comment

Popular posts from this blog

Characteristics of computers

    Characteristics:        All computers have similar characteristics, which tells how computers are efficient to perform task. Computers have some Limitations also. Speed:     Computer can work very fast. It takes only few seconds for calculations on very large amount of data. Computer can perform millions (1,000,000) of instructions per second.      We measure the speed of computer in terms of microsecond (10-6 part of a second) or nanosecond (10 to the power -9 part of a second).   Accuracy:        The degree of accuracy of computer is very high and every calculation is performed with the same accuracy.  The errors in computer are due to human and inaccurate data.       The calculation done by computer are 100% error free, If we provide accurate input. Diligence:        A computer is free from tiredness, lack of concentration...

DS LAB FOR II YEAR

1.SINGLE LINKED LIST Procedure for creation of single linked list: STEP-1 : Declaring a variable named as “item”.Ie the element what we place in the linkedlist of the new node.         STEP-2 : Read the value   in “item”. Set first=last=null and next=null. STEP-3: Create a new node named as temp and assign the variable item to data part andassign Address of the node temp to null.       temp.data=item;       temp.next=null; STEP-4: Check   the address part of the first node Check if first=null Then assign first=last=temp Other wise Then assign the new node tolast.next=temp          last=temp STEP-6 : Repeat STEP-3 until you read required nodes. Procedure for display the linked list: STEP-1 : Check whether the list having nodes or not i.e Check if first=null        ...

Block diagram of computer

    The basic architecture of computer explained in Blocks is called Block Diagram of computer. This basic architecture of computer finally given by John V on Neumann. Thus it is also called  V on Neumann  architecture. It  is a theoretical design for computer that serves as the basis for almost all modern computers. Input Unit:      We need to input (fed) the data and instructions into the computers to process any task. The input unit consists of one or more input devices.      Keyboard is the one of the most commonly used input device. Other commonly used input devices are the mouse. Output Unit:     The output unit of a computer provides the information and results of a computation to outside world.        Printers, Visual Display Unit (VDU) are the commonly used output devices.   Storage Unit:      The storage unit of the computer holds data and in...