the variable limits : Variable « Language Basics « C / ANSI-C

C / ANSI-C
1. assert.h
2. Console
3. ctype.h
4. Data Structure Algorithm
5. Data Type
6. Development
7. File
8. Function
9. Language Basics
10. Macro Preprocessor
11. Math
12. math.h
13. Memory
14. Pointer
15. setjmp.h
16. signal.h
17. Small Application
18. stdio.h
19. stdlib.h
20. String
21. string.h
22. Structure
23. time.h
24. wctype.h
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
C / ANSI-C » Language Basics » VariableScreenshots 
the variable limits
the variable limits

/*Finding the variable limits  */
#include <stdio.h>
#include < limits.h >   /* For limits on integer types        */
#include <float.h>      /* For limits on floating-point types */

void main()
{
  printf("char store values from %d to %d", CHAR_MIN, CHAR_MAX)
  
  printf("\n unsigned char store values from 0 to %u", UCHAR_MAX);
  
  printf("\n short store values from %d to %d", SHRT_MIN, SHRT_MAX);
  
  printf("\n unsigned short store values from 0 to %u", USHRT_MAX);
  
  printf("\n int store values from %d to %d", INT_MIN, INT_MAX);
  
  printf("\n unsigned int store values from 0 to %u", UINT_MAX);
  
  printf("\n long store values from %d to %d", LONG_MIN, LONG_MAX);
  
  printf("\n unsigned long store values from 0 to %u", ULONG_MAX);

  printf("\n\n smallest non-zero value of type float is %.3e", FLT_MIN);
  
  printf("\nThe size of the largest value of type float is %.3e", FLT_MAX);
  
  printf("\nThe size of the smallest non-zero value of type double is %.3e",
                                                        DBL_MIN);
  printf("\nThe size of the largest value of type double is %.3e", DBL_MAX);
  
  printf("\nThe size of the smallest non-zero value of type long double is %.3e",
                                                       DBL_MIN);
  printf("\nThe size of the largest value of type long double is %.3e\n",
                                                        DBL_MAX);
}



           
       
Related examples in the same category
1. demonstrate the use of variables
2. For and scanf
3. Finding the size of a typeFinding the size of a type
w_w_w___.j__av__a2s__.___c__om | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.