You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
877 B
30 lines
877 B
8 months ago
|
#include <stdio.h>
|
||
|
#include <limits.h>
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
printf("%d <= char <= %d\n", CHAR_MIN, CHAR_MAX);
|
||
|
printf("%d <= int <= %d\n", INT_MIN, INT_MAX);
|
||
|
printf("%ld <= long <= %ld\n", LONG_MIN, LONG_MAX);
|
||
|
printf("%d <= signed char <= %d\n", SCHAR_MIN, SCHAR_MAX);
|
||
|
printf("%d <= short <= %d\n", SHRT_MIN, SHRT_MAX);
|
||
|
printf("0 <= unsigned char <= %d\n", UCHAR_MAX);
|
||
|
printf("0 <= unsigned int <= %u\n", UINT_MAX);
|
||
|
printf("0 <= unsigned long <= %lu\n", ULONG_MAX);
|
||
|
printf("0 <= unsigned short <= %d\n", USHRT_MAX);
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
unsigned char x;
|
||
|
|
||
|
for (x = 1; x > x-1; ++x) {
|
||
|
if (x < 0)
|
||
|
break;
|
||
|
printf("%d\n", x); // печатаем для отладки программы
|
||
|
}
|
||
|
printf("MIN: %d\n", x);
|
||
|
printf("MAX: %d\n", --x);
|
||
|
return 0;
|
||
|
}
|