contoh program pascal case

uses crt;                                                                  
var nama,alamat:string;                                                     
gol :char;                                                                  
begin                                                                       
clrscr;                                                                     
writeln (‘=====================’);                                         
writeln (‘selamat datang kawan’);                                           
writeln (‘isikan data yang di butuhkan ‘);                                  
write (‘nama anda : ‘); readln (nama);                                      
write (‘alamat anda : ‘); readln (alamat);                                 
write (‘gol darah anda : ‘) ;readln (gol);                                  
case upcase (gol) of                                                       
‘A’ :begin                                                                  
write (‘golongan anda keren’);                                              
end;                                                                        
‘B’: write (‘juga keren’);                                                 
else write (‘salah golongan lu’);                                           
end;                                                                       
readkey;
repeat until keypressed;                                                   
end.                                          

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s