Home » Uncategorized » Membuat Status Bilangan 4 Versi

Membuat Status Bilangan 4 Versi

//Judul

Membuat Status Bilangan  4 Versi

//Kamus :

          a : integer

//Deskripsi  1 :

          input <- a

          if (a < 0) then

o    {

  •  Ouput  “negatif”

o   }

          Else if (a > 0) then

o   {

  •  Output  “positif”

o   }

          Else if (a mod 2 = 0) then

o   {

  •  Output  “genap”

o   }

          Else if (a mod 2 ≠ 0) then

o   {

  •  Output “ganjil”

o   }

          Else if

o   {

  •  Output “0”

o   }

// Deskripsi 2 :

          Input <- a

          If (a < 0) then

o   If (a mod 2 = 0) then

o   {

  •  Output “genap negatif”

o   }

o   Else (a mod 2 ≠ 0)

o   {

  •  Output “ganjil negatif”

o   }

          Else (a > 0)

o   If (a mod 2 = 0) then

o   {

  •  Output “genap postif”

o   }

o   Else (a mod 2 ≠ 0)

o   {

  •  Output ”ganjil positif”

o   }

          Else if

o   {

o   Output “0”

o   }

// Deskripsi 3 :

          Input <- a

          If (a > 0 and a mod 2 = 0) then

o   {

  •  Output “Positif Genap”

o   }

          Else if (a > 0 and a mod 2 ≠ 0) then

o   {

  •  Output “Positif Ganjil”

o   }

          Else if (a < 0 and mod 2 = 0) then

o   {

  •  Ouput “Negatif Genap”

o   }

          Else if (a < 0 and mod 2 ≠ 0) then

o   {

  •  Output “Negatif Ganjil”

o   }

          Else if

o   {

o   Output “0”

o   }

//Deskripsi 4 :

          Input <- a

          If (a < 0) then

o   {

o   Depend on (a)

  •  {
  •  a mod 2 = 0 : (Output “Negatif Genap“)
  •  a mod 2 ≠ 0 : (Output “Negatif Ganjil”)
  •  }

o   }

          Else if (a > 0) then

o   {

o   Depend on (a)

  •  {
  •  a mod 2 = 0 : (Output “Positif Genap”)
  •  a mod 2 ≠ 0 : (Output “Positif Ganjil”)
  •  }

o   }

          Else if ()

o   {

  •  Output “0”

o   }


Post a Comment

Your email address will not be published. Required fields are marked *