Minggu, 06 Mei 2012

Program Zodiak di C++

Disini kita hanya menggunakan logika IF & AND untuk menentukan zodiak seseorang .

 
 
 
 
#include
main()
{
clrscr();
int t, b;
cout<<"\n PROGRAM ZODIAK";

cout<<"\n Tanggal Lahir : "; cin>>t;
cout<<"\n Bulan Lahir : "; cin>>b;
if ((t>=21&&t<=31 && b==12) || (t>=1&&t<=20 && b==1)){
    cout<<"\n Bintang Anda Capricorn";}
    else if ((t>=21&&t<=31 && b==1) || (t>=1&&t<=20 && b==2)){
    cout<<"\nBintang Anda Aquarius";}
    else if((t>=21&&t<=28 && b==2) || (t>=1&&t<=20 && b==3)){
    cout<<"\nBintang Anda Pisces";}
    else if ((t>=21&&t<=31 && b==3) || (t>=1&&t<=20 && b==4)){
    cout<<"\nBintang Anda Aries";}
    else if((t>=21&&t<=30 && b==4) || (t>=1&&t<=20 && b==5)){
    cout<<"\nBintang Anda Taurus";}
    else if ((t>=21&&t<=31 && b==5) || (t>=1&&t<=20 && b==6)){
    cout<<"\nBintang Anda Gemini";}
    else if((t>=21&&t<=30 && b==6) || (t>=1&&t<=20 && b==7)){
    cout<<"\nBintang Anda Cancer";}
    else if((t>=21&&t<=31 && b==7) || (t>=1&&t<=20 && b==8)){
    cout<<"\nBintang Anda Leo";}
    else if((t>=21&&t<=31 && b==8) || (t>=1&&t<=20 && b==9)){
    cout<<"\nBintang Anda Virgo";}
    else if((t>=21&&t<=30 && b==9) || (t>=1&&t<=20 && b==10)){
    cout<<"\nBintang Anda Libra";}
    else if((t>=21&&t<=31 && b==10) || (t>=1&&t<=20 && b==11)){
    cout<<"\nBintang Anda Scorpio";}
    else if((t>=21&&t<=30 && b==11) || (t>=1&&t<=20 && b==12)){
    cout<<"\nBintang Anda Sagitarius";}

    getch();

}



Selamat Mencoba.

3 komentar:

  1. If you like reading zodiac predictions, you can visit our website https://nonazodiak.wixsite.com/nonazodiak

    BalasHapus
  2. Free Spins: Spins that can be played without using your own balance, often related to certain slot machines. For complete information, visit our website https://lerjekz.wixsite.com/chitos88

    BalasHapus

 
Copyright © . Kumpulan Tutorial Sederhana - Posts · Comments
Theme Template by BTDesigner · Powered by Blogger