-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput.txt
201 lines (169 loc) · 2.7 KB
/
input.txt
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
show:
print: asdsagh
//storing string in array
country1 = "bangladesh"
country2 = "usa"
len1 = len: country1
//declaring an int variable
int: start = 0
//declaring an float variable
float: temp = 33.4
print: "Integer and float expression" nl:
int: intvar = 4 * 5 / len1
float: floatvar = 4.2 - 6.7 * temp
print: intvar
print: floatvar
print: "switch case" nl:
int: swi = -45
switch:
=>
2 * swi - swi ) 1 + 2 + 3 ; swi
45) 1 * 3 * 3 ; swi
def: 1 + 2
<=
print: "If else" nl:
//if
if: 1 > -3
=>
1
<=
//if-else
if: 1 > 3
=>
2
<=
else:
=>
3
<=
//if-elseif-else
if: 1 > 3
=>
4
<=
elseif: 2 == 2
=>
5
<=
else:
=>
6
<=
//nested if-elseif-else
if: 1 > 2
=>
if: 8 == 6
=>
7
<=
else:
=>
8
<=
<=
elseif: 3 >= 3
=>
if: 8 == 6
=>
9
<=
else:
=>
10
<=
<=
else:
=>
if: 8 == 6
=>
11
<=
else:
=>
12
<=
<=
//Simple variable name and array name can be same
//array: temp 2
//array: temp 0 = 11
//array: temp 1 = 12
//print: array: temp
//print: temp
//array mechanism
print: "array mechanism" nl:
array: arr1 3
array: arr1 0 = 10
array: arr1 1 = 5.5
array: arr1 2 = 'z'
print: array: arr1
array: number 5
array: number 0 = 10
array: number 1 = 5
array: number 2 = 1
array: number 3 = 11
array: number 4 = 55
print: array: number
int: start = 0
len = len: number
lenofnumber = len: number
loop: start , len , + 1
=>
array: arr1 print:
<=
loop: start , lenofnumber , + 1
=>
array: number print:
<=
//print array using loop
print: "forward to backward using specialized loop" nl:
loop: start , len1 , +1
=>
array: country1 print:
<=
//print array using loop
print: "backward to forward using specialized loop" nl:
loop: len1 , start , - 1
=>
array: country1 print:
<=
//print array using simple loop
print: "forward to backward using simple loop" nl:
loop: start -> len1
=>
array: country1 print:
<=
print: "Printing a set of numbers"
loop: 1 , 100 , * 2
=>
print:
<=
print: "Built-in Functions" nl:
sort: asc: number
print: "Ascending order" nl:
loop: start , len , + 1
=>
array: number print:
<=
sort: des: number
print: "Descending order" nl:
loop: start , len , + 1
=>
array: number print:
<=
print: "Min-Max" nl:
min = min: number
max = max: number
print: "Min number = "
print: min
print: "Max number = "
print: max
sin = sin: 60.0
cos = cos: 60.0
tan = tan: 60.0
print: "Sin = "
print: sin
print: "Cos = "
print: cos
print: "Tan = "
print: tan
show: