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        ...

LEVELS AND CURVES

LEVELS:                 Levels are used to set the shadows, mid tone etc.  O pen an image on Photoshop window. Select image menu on menu bar than adjustments than levels. A dialogue box will appear on screen which shows three pointers which indicates three optimum. The black triangle indicates shadows and gray triangle indicates mid tone and white triangle indicates highlights. In the channel menu different options are provided in drop down list. Make sure select on preview, which gives current adjustments on your picture. CURVES: Curves are to  similar to levels, it gives more power to control shadows highlights and mid tones. One of the simplest adjustment we can make with curves is increasing the contrast. Go to image menu and than adjustments,than curves. Dialogue box will appear on screen with straight diagonal line.      ...