Update to 2-1
This commit is contained in:
parent
a300e1cc32
commit
ed3ea680f4
|
@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.0)
|
|||
|
||||
project(learningc LANGUAGES C)
|
||||
|
||||
set(CHAPTER 1)
|
||||
set(EXERCISE 24)
|
||||
set(CHAPTER 2)
|
||||
set(EXERCISE 2)
|
||||
|
||||
add_executable(learningc chapters/${CHAPTER}/exercises/${EXERCISE}.c)
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
printf("Char range is:\n");
|
||||
printf("\tSigned: %i to %i\n", CHAR_MIN, CHAR_MAX);
|
||||
printf("\tUnsigned: %i to %i\n", 0, UCHAR_MAX);
|
||||
printf("Short range is:\n");
|
||||
printf("\tSigned: %i to %i\n", SHRT_MIN, SHRT_MAX);
|
||||
printf("\tUnsigned: %i to %i\n", 0, USHRT_MAX);
|
||||
printf("Int range is:\n");
|
||||
printf("\tSigned: %i to %i\n", INT_MIN, INT_MAX);
|
||||
printf("\tUnsigned: %i to %i\n", 0, UINT_MAX);
|
||||
printf("Long range is:\n");
|
||||
printf("\tSigned: %li to %li\n", LONG_MIN, LONG_MAX);
|
||||
printf("\tUnsigned: %i to %lu\n", 0, ULONG_MAX);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue