Zamiana A na B
Użytkownik podaje frazę, a następnie program zamienia wszystkie litery “A” (lub małe “a”) odpowiednio na “B” (lub małe “b”).
Kompilator: Turbo Pascal
program zamianaAnaB;
uses crt;
var tekst:String;
i:integer;
begin
clrscr;
Write('Wprowadz tekst: ');
read(tekst);
for i:=1 to length(tekst) do if tekst[i]='a' then tekst[i]:='b'
else if tekst[i]='A' then tekst[i]:='B';
write(tekst);
readkey;
end.