Learning point C language (13): Data Type-integer, seasonal, and floating point extension

Source: Internet
Author: User
Integer int can be added with short and long: Short INT: short; long INT: long. Both can be added with unsigned: Unsigned INT: simple: unsignedunsigned short INT: simple: Unsigned shortunsigned long INT: simple: Unsigned longunsigned long INT: simple: Unsigned long longchar can be added unsigned: Unsigned chardouble can be added long: Long double

  

1. Short minimum and maximum values:

 
# Include <stdio. h> # include <limits. h> int main (void) {short n1 = shrt_min; short n2 = shrt_max; printf ("% d .. % d \ n ", N1, N2); getchar (); Return 0 ;}

  

2. Minimum and maximum values of long:

 
# Include <stdio. h> # include <limits. h> int main (void) {long n1 = long_min; long n2 = long_max; printf ("% lD .. % LD \ n ", N1, N2); getchar (); Return 0 ;}

  

3. The minimum and maximum values of long:

 
# Include <stdio. h> # include <limits. h> int main (void) {long n1 = llong_min; long n2 = llong_max; printf ("% LLD .. % LLD \ n ", N1, N2); getchar (); Return 0 ;}

  

4. The minimum values of the unsigned series are 0:

 
# Include <stdio. h> # include <limits. h> int main (void) {unsigned short n1 = ushrt_max; unsigned n2 = uint_max; unsigned long N3 = ulong_max; unsigned long N4 = ullong_max; unsigned char c = uchar_max; printf ("0 .. % u \ n ", N1); printf (" 0 .. % u \ n ", N2); printf (" 0 .. % lu \ n ", N3); printf (" 0 .. % LlU \ n ", N4); printf (" \ N0 .. % u \ n ", c); getchar (); Return 0 ;}

  

5. Minimum and maximum values of Long double:

# Include <stdio. h> # include <float. h> int main (void) {long double LD1 = ldbl_min; Long Double LD2 = ldbl_max; printf ("% Le .. % Le \ n ", LD1, LD2); getchar (); Return 0 ;}

  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.