C program to tell your zodiac sign, just input your birth date and month.

#include<stdio.h>
void main()
{
    int d,m;

    printf("Enter date (day):- ");
    scanf("%d", &d);

    printf("Enter month (1-12):- ");
    scanf("%d", &m);

    if(m==12&&d>=22||m==1&&d<=19)
        printf("\nCapricon");
    else if(m==1&&d>=20||m==2&&d<=17)
        printf("\nAquarius");
    else if(m==2&&d>=18||m==3&&d<=19)
        printf("\nPisces");
    else if(m==3&&d>=20||m==4&&d<=19)
        printf("\nAries");
    else if(m==4&&d>=20||m==5&&d<=20)
        printf("\nTaurus");
    else if(m==5&&d>=21||m==6&&d<=20)
        printf("\nGemini");
    else if(m==6&&d>=21||m==7&&d<=22)
        printf("\nCancer");
    else if(m==7&&d>=23||m==8&&d<=22)
        printf("\nLeo");
    else if(m==8&&d>=23||m==9&&d<=22)
        printf("\nVirgo");
    else if(m==9&&d>=23||m==10&&d<=22)
        printf("\nLibra");
    else if(m==10&&d>=23||m==11&&d<=21)
        printf("\nScorpio");
    else if(m==11&&d>=20||m==12&&d<=17)
        printf("\nSagittarius");
    else
        printf("\nInvalid Input");

}

Advertisements

#c