-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path06_Increment_dan_Decrement.mq4
37 lines (32 loc) · 1.1 KB
/
06_Increment_dan_Decrement.mq4
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
//+------------------------------------------------------------------+
//| Test.mq4 |
//| Copyright 2021, Maulana Aji Wicaksono |
//| https://www.instagram.com/aw.design30 |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, Maulana Aji Wicaksono"
#property link "https://www.instagram.com/aw.design30"
#property version "1.00"
#property strict
void OnStart(){
// increment dan decrement dalam bahasa MQL4
int a = 5;
int b = 5;
int c = 10;
int d = 10;
// Pre increment
Alert("Pre increment ", b);
Alert("Pre increment", ++b);
Alert("Pre increment ", b);
// Post increment
Alert("Post increment ", a);
Alert("Post increment", a++);
Alert("Post increment ", a);
// Pre decrement
Alert("Pre decrement ", c);
Alert("Pre decrement", --c);
Alert("Pre decrement ", c);
// Post decrement
Alert("Post decrement ", d);
Alert("Post decrement", d--);
Alert("Post decrement ", d);
}