Quick actions

cmd+k|ctrl+k

Navigation

Languages

Ranges of unsigned integers

Snippet info

Language

C

Visibility

public

Author

krishnakanth

Created

2022-11-20T02:36:27.939937Z

Updated

2022-11-20T02:36:27.939937Z


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

int main() 
{

    unsigned short ushort_max = USHRT_MAX;
    
    printf("Maximum value of unsigned short: %hu \n", ushort_max);    
    printf("Printing the size of unsigned short: %lu \n", sizeof(ushort_max));    

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

    unsigned int uint_max = UINT_MAX;

    printf("Maximum value of unsigned int: %u \n", uint_max);
    printf("Printing the size of int: %lu \n", sizeof(uint_max));

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

    unsigned long ulong_max = ULONG_MAX;

    printf("Maximum value of unsigned long: %lu \n", ulong_max);
    printf("Printing the size of unsigned long: %lu \n", sizeof(ulong_max));

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

    return EXIT_SUCCESS;
    
}
INFO