forked from sanya28wd/Python-Compiler-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_cases.txt
More file actions
94 lines (79 loc) · 1.24 KB
/
test_cases.txt
File metadata and controls
94 lines (79 loc) · 1.24 KB
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
/*
Test Cases for Lexical Analysis
This file contains test programs to verify the lexer's capabilities
*/
/* TEST 1: Basic Variable Declaration and Assignment */
int count;
float price;
count = 100;
price = 99.99;
/* TEST 2: Arithmetic Operations */
int a;
int b;
float result;
a = 10;
b = 20;
result = a + b;
result = a - b;
result = a * b;
result = a / b;
result = a % 5;
/* TEST 3: Relational Operators */
if (a < b) {
print(a);
}
if (a > b) {
print(b);
}
if (a <= b) {
print(a);
}
if (a >= b) {
print(b);
}
if (a == b) {
print(a);
}
if (a != b) {
print(b);
}
/* TEST 4: Boolean Operators */
if ((a > 0) && (b > 0)) {
print(a);
}
if ((a < 0) || (b < 0)) {
print(b);
}
if (!(a == 0)) {
print(a);
}
/* TEST 5: While Loop */
while (count > 0) {
count = count - 1;
print(count);
}
/* TEST 6: If-Else Structure */
if (count == 0) {
print(count);
}
else {
count = 10;
}
/* TEST 7: Block Structure */
{
int x;
float y;
x = 5;
y = 2.5;
print(x);
print(y);
}
/* TEST 8: Multiple Operations */
int m;
float n;
m = 15;
n = 3.7;
result = m + n;
if (result > 15.0) {
print(result);
}