-
Notifications
You must be signed in to change notification settings - Fork 0
/
quads.out
140 lines (140 loc) · 2.36 KB
/
quads.out
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
The Quad Array:
1: t1= a+b
2: c= t1
3: t2= c
4: t0= c
5: return c
6: t4= a-b
7: c= t4
8: t5= c
9: t3= c
10: return c
11: t7= a*b
12: c= t7
13: t8= c
14: t6= c
15: return c
16: t10= a/b
17: c= t10
18: t11= c
19: t9= c
20: return c
21: t13= a%b
22: c= t13
23: t14= c
24: t12= c
25: return c
26: t16= "\nEnter 1 to add \n 2 to subtract\n 3 to multiply \n 4 to divide \n 5 for modulo \n 6 for exit\n"
27: ab= t16
28: t17= "The value of Computation is : "
29: bc= t17
30: t18= "Enter the element a: "
31: de= t18
32: t19= "Enter the element b: "
33: ef= t19
34: t20= "\n"
35: fg= t20
36: param ab
37: call prints,1
38: readi= callreadi,0
39: n= readi
40: t21= n
41: t22= 1
42: 43: goto 138
44: t23= 5
45: if ( n<t23 ) goto 48
46: goto 138
47: goto 138
48: param de
49: call prints,1
50: readi= callreadi,0
51: a= readi
52: t24= a
53: param ef
54: call prints,1
55: readi= callreadi,0
56: b= readi
57: t25= b
58: t26= 1
59: if ( n==t26 ) goto 62
60: goto 70
61: goto 122
62: t27= b
63: t28= a
64: param t27
65: param t28
66: t29= calladd,2
67: ans= t29
68: t30= ans
69: goto 122
70: t31= 2
71: if ( n==t31 ) goto 74
72: goto 82
73: goto 121
74: t32= b
75: t33= a
76: param t32
77: param t33
78: t34= callsub,2
79: ans= t34
80: t35= ans
81: goto 122
82: t36= 3
83: if ( n==t36 ) goto 86
84: goto 94
85: goto 120
86: t37= b
87: t38= a
88: param t37
89: param t38
90: t39= callmult,2
91: ans= t39
92: t40= ans
93: goto 122
94: t41= 4
95: if ( n==t41 ) goto 98
96: goto 106
97: goto 119
98: t42= b
99: t43= a
100: param t42
101: param t43
102: t44= calldiv,2
103: ans= t44
104: t45= ans
105: goto 122
106: t46= 5
107: if ( n==t46 ) goto 110
108: goto 122
109: goto 118
110: t47= b
111: t48= a
112: param t47
113: param t48
114: t49= callmod,2
115: ans= t49
116: t50= ans
117: goto 122
118: goto 122
119: goto 122
120: goto 122
121: goto 122
122: param fg
123: call prints,1
124: param bc
125: call prints,1
126: param ans
127: call printi,1
128: param fg
129: call prints,1
130: param fg
131: call prints,1
132: param ab
133: call prints,1
134: readi= callreadi,0
135: n= readi
136: t51= n
137: goto 41
138: t52= 0
139: t15= t52
140: return t52