Unit 1 An Overview of C Language -Tin học đại cương (IT1110)
Unit 1 An Overview of C Language
Preview text:
lOMoAR cPSD| 27879799
Downloaded by VietJack TV Official (vietjackvideos@gmail.com) lOMoAR cPSD| 27879799
Downloaded by VietJack TV Official (vietjackvideos@gmail.com) lOMoAR cPSD| 27879799 3
Downloaded by VietJack TV Official (vietjackvideos@gmail.com) lOMoAR cPSD| 27879799 Derived from the B language 4 lOMoAR cPSD| 27879799 Labs in the 1980s.
Overcame several shortcomings of C 5 lOMoAR cPSD| 27879799 Weak typing 6 lOMoAR cPSD| 27879799
C++ adds more libraries with functions for object 7 lOMoAR cPSD| 27879799 8 lOMoAR cPSD| 27879799 9 lOMoAR cPSD| 27879799 The Search Menu 10 lOMoAR cPSD| 27879799 11 lOMoAR cPSD| 27879799 12 lOMoAR cPSD| 27879799 And ends this way 13 lOMoAR cPSD| 27879799 A Sample C Program 1. #include 2. #include 3. main () 4. { 5.
printf("Size of Char Max %d\n", CHAR_MAX); 6.
printf("Size of Char Min %d\n", CHAR_MIN); 7.
printf("Size of int min %d\n", INT_MIN); 8.
printf("Size of int max %d\n", INT_MAX); 9.
printf("Size of long min %ld\n", LONG_MIN); 10.
printf("Size of long max %ld\n", LONG_MAX);11. printf("Size of short min %d\n", SHRT_MIN); 12.
printf("Size of short max %d\n", SHRT_MAX); 13.
printf("Size of unsigned char %u\n", UCHAR_MAX); 14.
printf("Size of unsigned long %lu\n", ULONG_MAX); 15.
printf("Size of unsigned int %u\n", UINT_MAX); 16.
printf("Size of unsigned short %u\n", USHRT_MAX); 14 lOMoAR cPSD| 27879799 17.} 15 lOMoAR cPSD| 27879799 16 lOMoAR cPSD| 27879799 C Program Structure 17 lOMoAR cPSD| 27879799 #include 18 lOMoAR cPSD| 27879799 Variable Declarations Example declarations: lOMoAR cPSD| 27879799 Data Types Integer variables: int a, b ;
Integer variables, like a or b, store only whole
numbers like 3 or 7, not 3.33 or 7.65, and only up to certain maximum values. Floating point variables: float c, d ;
Floating point variables, like c or d, store rational
numbers, like 3.14159, but only a limited number of digits of precision. 20