Program Hitung Kata dengan Pascal

Share On :



 

program HitungKata;
uses wincrt;
type
nomor = 1..21;
Larik = array[nomor] of char;
const
Kalimat : Larik = ('W','H','E','N',' ','S','A','N','K','A','L','A',' ','T','A','L','K','I','N','G','.');
var
x,jumlah : integer;
begin
if Kalimat[1] = '.' then writeln('Ini teks kosong!') else
begin
x := 1;
jumlah := 1;
while Kalimat[x] <> '.' do
begin
write(Kalimat[x]);
if (Kalimat[x] = ' ') and (Kalimat[x-1] <> ' ') then jumlah := jumlah+1;
x := x+1;
end;
end;
writeln;
writeln ('**************************') ;
writeln('Katanya Berjumlah : ',jumlah,' buah');
writeln ('**************************') ;
end.


Ini Hasil setelah programnya di running :



0 komentar:

Post a Comment

  • Mahasiswa STMIK Duta Bangsa
  • description
  • description
  • description
  • description
  • description
  • description
  • description

Free Hosting

Free Hosting

My Blog List

A
B
C
     
D
E
F
DuGMp3    
G
H
I
Goo Otomotif HouseofScript  
J
K
L
Java Hotline    
M
N
O

My Games Collection

MeLangKah LeBih MaJu

   
P
Q
R
Pamella Decoration    
S
T
U
Studied WaLL    
V
W
X
     
Y
Z
0-9
     









Join....!


Free Domain

Free Domain

SiNyO. Powered by Blogger.