Pascal : Coding Hitung Jumlah Karakter dalam Kalimat
December 21, 2019 No Comments Ari Usman,Artikel Komputer,Pascal Ari Usman

Program Hitung_Karakter_dalam_Kalimat;
uses crt;
var kalimat:string;
i,p,karakter:integer;
begin
clrscr;
writeln(‘ ———————————————— ‘);
writeln(‘ PROGRAM MENGHITUNG JUMLAH KARAKTER DALAM KALIMAT ‘);
writeln(‘ ———————————————— ‘);
writeln;
writeln(‘ Ketikkan sebuah kalimat : ‘);
writeln;
write(‘ ‘);readln(kalimat);
p:=length(kalimat); karakter:= 0;
for i:=1 to p do
begin
if kalimat[i]in[‘a’..’z’,’ ‘] then karakter := karakter+1;
end;
writeln;
writeln(‘ Jumlah karakter yang anda ketik ada : ‘,karakter,’ karakter ‘);
readkey;
end.

Visited 13 times, 1 visit(s) today
Tags
About The Author
Ari Usman Seorang Praktisi IT di Bidang Digital Marketing dan Dosen di Bidang Teknik Informatika

Leave a reply

Your email address will not be published. Required fields are marked *