PROGRAM MENGHITUNG JUMLAH KARAKTER DALAM KALIMAT (PASCAL)

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.

1 komentar:

BayuBayyz said...

Super sekali saya terbantu, terimakasih telah berbagi sob :D

 

Usage Rights

DesignBlog BloggerTheme comes under a Creative Commons License.This template is free of charge to create a personal blog.You can make changes to the templates to suit your needs.But You must keep the footer links Intact.