Weirdo

PROGRAM WEIRDO; USES CRT; VAR N:INTEGER; TMP:INTEGER; I:INTEGER; J:INTEGER; A:ARRAY[1..7] OF INTEGER; BEGIN A[1]:=1;A[2]:=3;A[3]:=5;A[4]:=7;A[5]:=6;A[6]:=4;A[7]:=2; N:=7; J:=A[N]; FOR I:=1 TO N-1 DO BEGIN TMP:=A[J]; A[J]:=J; J:=TMP; END; WRITELN('RESULT IS'); FOR I:=1 TO N DO BEGIN WRITE(A[I],' '); END; END. What the…

Continue Reading