contoh program menampilkan nama bulan sesuai dengan angka yang dimasukkan

#include
#include

void main ()
{
clrscr ();
int a ;
printf (“masukan angka=”),scanf(“%i”,&a);
switch (a)
{
case 1: printf (“januari\n”);
printf (“satu\n”);
printf (“I\n”);
break;
case 2: printf (“februari\n”);
printf (“dua\n”);
printf (“II\n”);
break;
case 3: printf (“maret\n”);
printf (“tiga\n”);
printf (“III\n”);
break;
case 4: printf (“april\n”);
printf (“empat\n”);
printf (“IV\n”);
break;
case 5: printf (“mai\n”);
printf (“lima\n”);
printf (“V\n”);
break;
case 6: printf (“juni\n”);
printf (“enam\n”);
printf (“VI\n”);
break;
case 7: printf (“juli\n”);
printf (“tujuh\n”);
printf (“VII\n”);
break;
case 8: printf (“agustus\n”);
printf (“delapan\n”);
printf (“VIII\n”);
break;
case 9: printf (“september\n”);
printf (“sembilan\n”);
printf (“IX\n”);
break;
case 10: printf (“oktober”);
printf (“sepuluh\n”);
printf (“X\n”);
break;
case 11: printf (“november\n”);
printf (“sebelas\n”);
printf (“XI\n”);
break;
case 12: printf (“desember\n”);
printf (“dua belas\n”);
printf (“XII\n”);
break;
default : printf (“only 1-12\n”);
printf (“please try again!!!”);
}
getch ();

}

About these ads

About Nobel kurniadi

hello i'm nobel who are you?

Posted on September 23, 2011, in Pemrograman. Bookmark the permalink. Leave a comment.

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

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: