-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestcases.txt
58 lines (51 loc) · 980 Bytes
/
testcases.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
program area;
{* it is program to calculate the area of
Square or rectangle based on the values of user*}
var
width, height :integer ;
area : real;
answer : char ;
begin
repeat
writeln('Please enter two values');
readln(width);
readln(height);
if width = height then
writeln('the area of square');
else
writeln('the area of rectangle');
area:= width* height;
writeln(area);
writeln('do you want to continue? enter y or n');
readln(answer);
until answer = y;
writeln('Finished');
end.
Program sum;
{write program to sum from I to n}
Var
N,sum, end :integer;
Begin
Sum:=0;
Writeln('enter the end value');
Readln(end)
for N:=1 to end do
sum:= sum+ N;
writeln('the sum is equal to');
writeln(sum);
End.
program factorial;
{ it is program to calculate factorial}
var
n, fact: integer ;
fact:= 1;
writeln('Please enter the number');
readln(n);
begin
repeat
fact:= fact *n;
n := n- 1;
until n = 1;
writeln('the value of you factorial');
write(fact);
end.