1. Welcome to PHCorner Forums. Take a moment to Sign up and gain unlimited access and extra privileges that guests are not entitled to, such as:

    All that and more! Registration is quick, simple and absolutely free. Join our community today!

please pa correct sa code

Discussion in 'Coding, Programming' started by enachris, Sep 22, 2015.

  1. hello sa inyo first years student ako sa BSIT... pa correct po ng correct please.. gumawa ng program na pag eninter mo ang iyong birth month at birth date, it will determine your zodiac sign. C program gamit ko sa TC... salamat

    #include<stdio.h>
    #include<conio.h>
    main()
    {
    int month,date;
    clrscr();
    printf("\n Enter your birth month and birth date");
    scanf("%d",&month,date);
    if ((month == 1 && date >= 20)(month == 2 && date <=18))
    printf("\n Your zodiac sign is AQUARIUS");
    else if (( month == 2 && date >= 19)( month == 3 && date <= 20))
    printf("\n Your zodiac sign is PISCES");
    else if (( month == 3 && date >= 21)( month == 4 && date <= 19))
    printf("\n Your zodiac sign is ARIES");
    else if (( month == 4 && date >= 20)( month == 5 && date <= 20))
    printf("\n Your zodiac sign is TAURUS");
    else if (( month == 5 && date >= 21 )( month == 6 && date <= 20 ))
    printf("\n Your zodiac sign is GEMINI");
    else if (( month == 6 && date >= 21 )( month == 7 && date <= 22 ))
    printf("\n Your zodiac sign is CANCER");
    else if (( month == 7 && date <= 23 )( month == 8 && date <= 22))
    printf("\n Your zodiac sign is LEO");
    else if (( month == 8 && date >= 23 )( month == 9 && date <= 22 ))
    printf("\n Your zodiac sign is VIRGO");
    else if (( month == 9 && date >= 23 )( month == 10 && date <= 22))
    printf("\n Your zodiac sign is LIBRA");
    else if (( month == 10 && date >= 23 )( month == 11 && date <= 21))
    printf("\n Your zodiac sign is SCORPIO");
    else if (( month == 11 && date >= 22 )( month == 12 && date <= 21))
    printf("\n Your zodiac sign is SAGUITTARIUS");
    else if (( month == 12 && date >= 22 )( month == 1 && date <= 19 ))
    printf("\n Your zodiac sign is CAPRICORN");
    else
    printf("\n INVALID INPUT");
    getch();
    return(0);
    }
     
  2. san ka nag aaral wait debug ko
     
    enachris likes this.
  3. enachris and Forbidden Eye like this.
  4. thanks kuya.. try ko salamat ulit
     
  5. san ka nag aaral
     
    enachris likes this.
  6. from dipolog city ako... :) sa saint vincent college
     
  7. ahhhh ok keep it up pag butihin mo yan
     
    enachris likes this.
  8. vhin le

    vhin le Honorary Poster Established

    scanf("%d",&month,date);
    dapat ganito >> scanf("%d %d",&month,&date);

    Reason: 2 values kxe hinihingi mo...
     
    enachris likes this.
  9. hello po thanks sa help..
    at pede pagawa ng flow chart..
    salamat
     
  10. vhin le

    vhin le Honorary Poster Established

    flowchart ng?
     
  11. yung pong pinost ko :) medyo nahirapan ako sa flowchart.. thanks
     
  12. hello yung pinost ko oki na yung pero sabi ng teacher ng dapat daw may
    continue asking the user if he/she wants to test another input.

    Sample Output:
    Enter your birth month and birth date as a number: 08 16

    Your zodiac sign is LEO

    pa help namn po kung ano code ang gagamitin ko.
     
  13. Gumawa kayo ng Github account... : )
    o di kya gamitin nyo to:
    Please or Register to view links
     
Tags / Keywords: