Quick actions

cmd+k|ctrl+k

Navigation

Languages

Range's of Signed integers

Snippet info

Language

C

Visibility

public

Author

krishnakanth

Created

2022-11-20T02:14:08.17563Z

Updated

2022-11-20T02:14:08.17563Z

# include <stdlib.h>
# include <stdio.h>
# include <limits.h>

int main() 
{

    signed short short_min = SHRT_MIN;
    signed short short_max = SHRT_MAX;
    
    printf("Minimim value of short: %hd \n", short_min);    
    printf("Maximum value of short: %hd \n", short_max);    
    printf("Printing the size of short: %lu \n", sizeof(short_max));    

    printf("\n-----------------------------\n\n");

    signed int int_max = INT_MAX;
    signed int int_min = INT_MIN;

    printf("Minimim value of int: %d \n", int_min);
    printf("Maximum value of int: %d \n", int_max);
    printf("Printing the size of int: %lu \n", sizeof(int_max));

    printf("\n-----------------------------\n\n");

    signed long long_min = LONG_MIN;
    signed long long_max = LONG_MAX;

    printf("Minimim value of long: %ld \n", long_min);
    printf("Maximum value of long: %ld \n", long_max);
    printf("Printing the size of long: %lu \n", sizeof(long_max));

    printf("\n-----------------------------\n\n");

    return EXIT_SUCCESS;
}
INFO