[IT] Java기초(4) - 연산자(Operator), 제어문(if ~ else 문)
□ 연산자 * 데이터, 그 다음 단계는? - 변수를 통해서 데이터를 보관하는 구조를 생각한 다음은? - 실제로 계산하는 작업을 하고 - 알아서 판단해서 작업하기를 원합니다. * 연산자(Operator) - 쉽게 말해서 CPU가 뭔가 계산하는 것. 결과가 발생 - 연산자를 이용 : 산술, 논리 등... * 연산자의 종류 - 산술(Arithmetic) 연산자 : +, - , *, /, %(나머지) - 단항(Unary) 연산자 : +, -, ++, --, ! - 동등(Equality) 연산자 : ==, !=, >, >=, , >,
2021. 11. 17.
[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.