-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoperators.dart
More file actions
46 lines (37 loc) · 827 Bytes
/
Copy pathoperators.dart
File metadata and controls
46 lines (37 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import 'dart:async';
void main() {
// Arithematic Operators
mathOperator();
// Increment and Decrement Operators
intdec();
// Type Test Operators
typeTest();
}
// Arithematic Operators
dynamic mathOperator = () {
num a = 7;
num b = 5;
print("Sum: ${a + b}");
print("Minus: ${a - b}");
print("Mul: ${a * b}");
print("Div: ${a / b}");
print("Modulus: ${a % b}");
};
// Increment and Decrement Operators
dynamic intdec = () {
int a = 1;
// return actual value before increament
print(a++);
print(a++);
// return actual value before decreament
print(a--);
// remove value by 1
print(--a);
};
// Type Test Operators
dynamic typeTest = () {
int a = 10;
String b = "demo";
print("TypeTest: ${a is int}"); // return true
print("TypeTest: ${b is! String}"); // return false
};