Pengeksekusian

#include
main ()
{

    char pilihan;
        printf("\n\n");
        ulang:
        printf("____________________________________"); printf("\n\n");
        printf("      Pilihan Perhitungan Luas      "); printf("\n");
        printf("____________________________________"); printf("\n\n");
        printf("1. Menghitung Luas Persegi Panjang ="); printf("\n\n");
        printf("2. Menghitung Luas Persegi ========="); printf("\n\n");
        printf("0. Selesai ========================="); printf("\n");
        printf("____________________________________"); printf("\n\n\n\n");
        kembali :
        printf("************************************"); printf("\n\n");
        printf("  Pilihan Angka (0, 1 atau 2 ): "); scanf("%d",&pilihan); printf("\n");
        printf("************************************"); printf("\n");
        printf("\n\n");
        switch (pilihan)

            {
                case 1:
                    {
                       int p,l,luas;
                       printf("==================================== \n\n");
                       printf("  Menghitung Luas Persegi Panjang    \n\n");
                       printf("==================================== \n\n");
                       printf("Masukkan Panjang     = ");scanf("%d",&p);
                       printf("\n");
                       printf("Masukkan Lebar       = ");scanf("%d",&l);
                           {
                             printf("\n");
                             if(l>p)
                               {
                                 if (p                                 printf ("Maaf Panjang Harus Lebih Besar Dari Pada Lebar \n\n");
                                 goto kembali;
                               }
                           }
                           {
                             if (p<0 br="" l="">                               {
                                 if (p>0,l>0|p)
                                 printf ("Maaf Nilai Min Tidak Diterima \n\n");
                                 goto kembali;
                               }
                           }
                       luas = p*l;
                       printf("Luas Persegi Panjang = %d cm \n\n",luas);
                       goto ulang;
                       break;
                    }

                case 2:
                    {
                       int s,luas;
                       printf("==================================== \n\n");
                       printf("      Menghitung Luas Persegi        \n\n");
                       printf("==================================== \n\n");
                       printf("Masukkan Sisi  = ");scanf("%d",&s);
                       printf("\n");
                       luas = s*s;
                       printf("Luas Persegi   = %d cm \n\n",luas);
                       goto ulang;
                       break;
                    }

                case 0:
                    {
                       printf("Selamat Program Berjalan Lancar..!! \n");
                       printf("Good Bye.....!!!!!\n");
                       break;
                    }

        default:printf("Angka Tidak Terdaftar \n\n");
                printf("Silahkan Input Angka Yang Benar\n\n");
                goto ulang;
            }
    return 0;
}

Post a Comment

1. Jangan lupa tinggalkan Likenya ya
2. Berkomentarlah dengan baik dan sopan

[blogger]

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget