Program Hitung Huruf NG dengan Pascal

Share On :
 
program hitung_NG;
uses wincrt;
type
nomor = 1..22;
Larik = array[nomor] of char;
const
Kalimat : Larik = ('W','H','E','N',' ','S','A','N','G','K','A','L','A',' ','T','A','L','K','I','N','G','#');
var
x,jumlah : integer;
begin
if Kalimat[1] = '#' then writeln('Cuma Teks Kosong...') else
begin
x := 1;
jumlah := 0;
while Kalimat[x] <> '#' do
begin
write(Kalimat[x]);
if (Kalimat[x] = 'N') and (Kalimat[x+1] = 'G') then jumlah := jumlah+1;
x := x+1;
end;
end;
writeln;
writeln ('**********************************************') ;
writeln('Frekuensi pasangan huruf NG berjumlah : ',jumlah,' buah');
writeln ('**********************************************') ;
end.

Nah 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.