-
Notifications
You must be signed in to change notification settings - Fork 0
/
correct2.c
executable file
·143 lines (64 loc) · 1.36 KB
/
correct2.c
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
#include "pilib.h"
#include <math.h>
/* program */
int j = 3 , i , w = 10 , k , y = 45 ;
double t;
const double N1 = -100 , N2 = 0 , N3 = 10 , N4 = 100 ;
const char* s1 = "Give a real number" ;
int main () {
double i , j ;
writeString("Give a real number:" );
i = readReal();
writeString(s1);
j = readReal();
if (i < N1 && j < N1)
{
writeString("Numbers " );
writeReal(i);
writeString(", " );
writeReal(j);
writeString(" are smaller than " );
writeReal(N1);
writeString("\n" );
}
else if (i < N2 && j < N2)
{
writeString("Numbers " );
writeReal(i);
writeString(", " );
writeReal(j);
writeString(" are smaller than " );
writeReal(N2);
writeString("\n" );
}
else if (i < N3 && j < N3)
{
writeString("Numbers " );
writeReal(i);
writeString(", " );
writeReal(j);
writeString(" are smaller than " );
writeReal(N3);
writeString("\n" );
}
else if (i < N4 && j < N4)
{
writeString("Numbers " );
writeReal(i);
writeString(", " );
writeReal(j);
writeString(" are smaller than " );
writeReal(N4);
writeString("\n" );
}
else {
writeString("Numbers " );
writeReal(i);
writeString(", " );
writeReal(j);
writeString(" are not both smaller than " );
writeReal(N4);
writeString("\n" );
}
}
// Your program is syntactically correct!