# Session 3

## | Operators and Expressions Session 3 Operators and Expression Objectives Explain Assignment Operator Understand Arithmetic Expressions Explain Relational and Logical Operators Understand Bitwise logical operators and expressions Explain casts Understand Precedence of Operators Elementary Programming with C/Session 3/ of 25 Expressions Combination of Operators and Operands Example 2 * y + 5 Operands Operators Elementary Programming with C/Session 3/ of 25 The Assignment Operator variable_name = expression; lvalue rvalue Assignment operator The assignment operator(=) can be used with any valid C expression (Left value) (Right value) Elementary Programming with C/Session 3/ of 25 Multiple Assignment Many variables can be assigned the same value in a single statement a = b = c = 10; However, you cannot do this : int a = int b = int b = int c = 10 X Elementary Programming with C/Session 3/ of 25 Operators 4 Types Arithmetic Relational Logical Bitwise Elementary Programming with C/Session 3/ of 25 Arithmetic Expressions Mathematical expressions can be expressed in C using arithmetic operators Examples a * (b + c/d)22 ++i % 7 5 + (c = 3 + 8) Elementary Programming with C/Session 3/ of 25 Relational & Logical Operators-1 Test the relationship between two variables, or between a variable and a constant Used to Relational Operators Elementary Programming with C/Session 3/ of 25 Logical operators are symbols that are used to combine or negate expressions containing relational operators Relational & Logical Operators-2 Expressions that use logical operators return zero for false, and 1 for true Example: if (a>10) && (a Elementary Programming with C/Session 3/ of 25 Bitwise Logical Operators-1 Processes data after converting number to its binary equivalent. (Bit wise representation) AND ( NUM1 & NUM2) Return 1 if both the operands are 1 OR ( NUM1 | NUM2 ) Returns 1 if bits of either of the operand are 1 NOT ( ~ NUM1) Reverses the bits of | Operators and Expressions Session 3 Operators and Expression Objectives Explain Assignment Operator Understand Arithmetic Expressions Explain Relational and Logical Operators Understand Bitwise logical operators and expressions Explain casts Understand Precedence of Operators Elementary Programming with C/Session 3/ of 25 Expressions Combination of Operators and Operands Example 2 * y + 5 Operands Operators Elementary Programming with C/Session 3/ of 25 The Assignment Operator variable_name = expression; lvalue rvalue Assignment operator The assignment operator(=) can be used with any valid C expression (Left value) (Right value) Elementary Programming with C/Session 3/ of 25 Multiple Assignment Many variables can be assigned the same value in a single statement a = b = c = 10; However, you cannot do this : int a = int b = int b = int c = 10 X Elementary Programming with C/Session 3/ of 25 Operators 4 Types Arithmetic Relational Logical Bitwise Elementary .

TÀI LIỆU LIÊN QUAN
32    57    1
25    199    2
7    63    0
55    301    6
23    153    0
23    97    0
7    45    0
41    75    12
17    31    2
9    482    32
TÀI LIỆU XEM NHIỀU
13    37402    2091
3    23124    235
25    22170    4103
16    18457    2754
20    18174    1512
14    16937    2828
1    16889    568
37    14707    2902
3    13667    268
23    12243    440
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
3    37    1    10-06-2023
174    20    1    10-06-2023
70    25    1    10-06-2023
7    25    2    10-06-2023
10    31    1    10-06-2023
6    12    1    10-06-2023
85    19    1    10-06-2023
44    53    2    10-06-2023
81    80    11    10-06-2023
194    35    1    10-06-2023
27    27    2    10-06-2023
51    38    4    10-06-2023
95    189    10    10-06-2023
97    13    1    10-06-2023
17    140    1    10-06-2023
22    35    2    10-06-2023
7    40    2    10-06-2023
9    173    1    10-06-2023
9    37    1    10-06-2023
15    42    2    10-06-2023
TÀI LIỆU HOT
3    23124    235
13    37402    2091
3    2022    79
580    4166    359
62    5582    1
584    2500    94
171    4818    666
2    2266    77
51    3330    175
53    4002    186
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.