[IT] C언어 입문(5) Operators, 연산자 - 논리연산자, 단축평가, 대입연산자, if문 및 while문 활용
□ 연산자 * Logical Operators - !, ||, && - logical_expression ::= logical_negation_expr | logical_or_expr | logical_and_expr - logical_negation_expr ::= !expr (not) - logical_or_expr ::= expr || expr (or) - logical_and_expr ::= expr && expr (and) - The result is 0 or 1 (int) - ex) (804; // b=00000000 - shift operator는 2, 4, 8, 16 ... 을 곱하는 효과가 있음 * Compound assignment operators - " +=, -=, *=, /=, ..
2021. 8. 22.
[IT] C언어 입문(4) Operators, 연산자 - scanf, 산술연산자, 관계연산자, 증감연산자, 대입연산자, 동등연산자 등
□ 기본연산자 * scanf - Analogous to printf, but used for input - scanf is passed a list arguments, control_string and other arguments - other arguments : addresses - ex) scanf("%d", &x); => &x : the address of x, The format %d is matched with &x - When reading numbers, it skips white space (blanks, newlines, and tabs) but when reading in a character white space is not skipped. c : Character d : Decim..
2021. 8. 21.
[IT] C언어 입문(3) Data types, 데이터 타입(자료형)
□ data types * Suffixes(접미사) for Data Type : int - int long, unsigned long - U or u : unsigned, ex) 25U, 0x32u - L or l : long, ex) 37L, 0x27L - UL or ul : unsigned long, 56uL, 234UL * Floating types - Variables of this type hold real values - float : 4bytes, 6 decimal places - double : 8bytes, 15 decimal places - long double : 12bytes, the compiler may provide more storage than double * Suffixe..
2021. 8. 20.