Algoritma & Metode Skripsi

header ads

Turbo C++ Programming Zodiac using IF - Then - ELSE

Zodiac with C++ | Diwapedia

In a previous post I had explained this zodiac programming using switch-case media. In this post, I made the zodiac program similar to Turbo C + +, but by using a program IF-THEN-ELSE. for the script please copy and paste the purpose of that program I made this just to increase your knowledge only.

# Include <stdio.h>void main (){

    int month;

    int date;

    printf ("ZODIAC  n");

    printf ("created by Diwapedia.me n n");

    printf ("Enter your birth month as a number:");

    scanf ("% d", & month);

    if (month == 1)

        {

            printf (" nYou born in JANUARY  n  n");

            printf ("Please enter your date of birth:");

                    scanf ("% d", & date);

                    if (date> = 21)

                    printf ("You Are the Zodiac AQUARIUS  n");

                    else

                        if (date <21)

                        printf ("You Are the Zodiac CAPRICORN  n  n");

        }

    else

    if (month == 2)

        {

            printf (" nYou born in FEBRUARY  n  n");

            printf ("Please enter your date of birth:");

                    scanf ("% d", & date);

                    if (date> = 20)

                    printf ("You Are the Zodiac PISCES  n");

                    else

                        if (date <20)

                        printf ("You Are the Zodiac AQUARIUS  n  n");

        }

    else

    if (month == 3)

        {

            printf (" nYou born in MARCH  n  n");

            printf ("Please enter your date of birth:");

                    scanf ("% d", & date);

                    if (date> = 21)

                    printf ("You Are the Zodiac ARIES  n");

                    else

                        if (date <21)

                        printf ("You Are the Zodiac PISCES  n  n");

        }

    else

    if (month == 4)

        {

            printf (" nYou born in APRIL  n  n");

            printf ("Please enter your date of birth:");

                    scanf ("% d", & date);

                    if (date> = 21)

                    printf ("You Are the Zodiac TAURUS  n");

                    else

                        if (date <21)

                        printf ("You Are the Zodiac ARIES  n  n");

        }

    else

    if (month == 5)

        {

            printf (" nYou born in MEI  n  n");

            printf ("Please enter your date of birth:");

                    scanf ("% d", & date);

                    if (date> = 21)

                    printf ("You Are the Zodiac GEMINI  n");

                    else

                        if (date <21)

                        printf ("You Are the Zodiac TAURUS  n  n");

        }

    else

    if (month == 6)

        {

            printf (" nYou born in JUNE  n  n");

            printf ("Please enter your date of birth:");

                    scanf ("% d", & date);

                    if (date> = 22)

                    printf ("You Are the Zodiac CANCER  n");

                    else

                        if (date <22)

                        printf ("You Are the Zodiac GEMINI  n  n");

        }

    else

    if (month == 7)

        {

            printf (" nYou born in JULY  n  n");

            printf ("Please enter your date of birth:");

                    scanf ("% d", & date);

                    if (date> = 23)

                    printf ("You Are the Zodiac LEO  n");

                    else

                        if (date <23)

                        printf ("You Are the Zodiac CANCER  n  n");

        }

    else

    if (month == 8)

        {

            printf (" nYou born in AUGUST  n  n");

            printf ("Please enter your date of birth:");

                    scanf ("% d", & date);

                    if (date> = 24)

                    printf ("You Are the Zodiac VIRGO  n");

                    else

                        if (date <24)

                        printf ("You Are the Zodiac LEO  n  n");

        }

    else

    if (month == 9)

        {

            printf (" nYou born in SEPTEMBER  n  n");

            printf ("Please enter your date of birth:");

                    scanf ("% d", & date);

                    if (date> = 23)

                    printf ("You Are the Zodiac LIBRA  n");

                    else

                        if (date <23)

                        printf ("You Are the Zodiac VIRGO  n  n");

        }

    else

    if (month == 10)

        {

            printf (" nYou born in OCTOBER  n  n");

            printf ("Please enter your date of birth:");

                    scanf ("% d", & date);

                    if (date> = 24)

                    printf ("You Are the Zodiac SCORPIO  n");

                    else

                        if (date <24)

                        printf ("You Are the Zodiac LIBRA  n  n");

        }

    else

    if (month == 11)

        {

            printf (" nYou born in NOVEMBER  n  n");

            printf ("Please enter your date of birth:");

                    scanf ("% d", & date);

                    if (date> = 23)

                    printf ("You Are the Star sign Sagittarius  n");

                    else

                        if (date <23)

                        printf ("You Are the Zodiac SCORPIO  n  n");

        }

    else

    if (month == 12)

        {

            printf (" nYou born in DECEMBER  n  n");

            printf ("Please enter your date of birth:");

                    scanf ("% d", & date);

                    if (date> = 22)

                    printf ("You Are the Zodiac CAPRICORN  n");

                    else

                        if (date <22)

                        printf ("You Are the Star sign Sagittarius  n  n");

        }}

Post a Comment

0 Comments