Home   Easy-Code    Forum  Updater 
Twitter Facebook



Program to find distinct letters in a line using pascal

Critics Rating:

Users Rating:

(*PROGRAM TO FIND DISTINCT LETTERS IN A LINE*)

Program distinct;

uses crt;

var

a,d: set of "A" .."Z";

ch:char;

begin

clrscr;

d:=[ ];

a:=["A".."Z"];

writeln("ENTER ANY SENTENCE IN UPPER CASE ");

read(ch);

while ch<>"." do

begin

if (ch in a) and not (ch in d) then

d:=d+[ch];

read(ch);

end;

writeln("THE DISTINCT LETTERS IN THE GIVEN SENTENCE ARE");

for ch := "A" to"Z" do

if ch in d then

write(ch:2);

end.





















Courtesy, Source, References & Regards: Kishore AVGK

While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright@2009-2011 by KuGuNi.com. All Rights Reserved.