So I'm asking the user for date of birth, and based on that I will output them a short sentence based on their zodiac. I can't seem to find any information on how to correctly proceed with this, or how I should go on about switch statements in this case. Any help is greatly appreciated!
int dateOfBirth;
// initiate zodiac animals year of birth
int rat = 2008 || 1996 || 1984 || 1972 || 1960;
int ox = 2009 || 1997 || 1985 || 1973 || 1961;
int tiger = 2010 || 1998 || 1986 || 1974 || 1962;
int rabbit = 2011 || 1999 || 1987 || 1975 || 1963;
int dragon = 2012 || 2000 || 1988 || 1976 || 1964;
int snake = 2013 || 2001 || 1989 || 1977 || 1965;
int horse = 2014 || 2002 || 1990 || 1978 || 1966;
int goat = 2015 || 2003 || 1991 || 1979 || 1967;
int monkey = 2016 || 2004 || 1992 || 1980 || 1968;
int rooster = 2017 || 2005 || 1993 || 1981 || 1969;
int dog = 2019 || 2007 || 1995 || 1983 || 1971;
int pig = 2019 || 2007 || 1995 || 1983 || 1971;
// ask user for date of birth
printf("Please enter your date of birth: \n");
scanf_s("%d", &dateOfBirth);
// FORTUNE IF STATEMENTS
// im tired of these motherfluffing IF STATEMENTS ON MY MOTHERFLUFFING SCREEN!
// rat
if (dateOfBirth == 2008 || 1997 || 1984 || 1972 || 1960)
{
printf("Jerry?%d\n", rat);
}
//ox
elseif(dateOfBirth == 2009 || 1997 || 1985 || 1973 || 1961);
{
printf("Nice horns m8");
}
// tiger
elseif(dateOfBirth == 2010 || 1998 || 1986 || 1974 || 1962);
{
printf("RAAWR\n");
}
// rabbit
elseif(dateOfBirth == 2011 || 1999 || 1987 || 1975 || 1963);
{
printf("HOP HOP HOP %d", rabbit);
}
// dragon
elseif(dateOfBirth == 2012, 2000, 1988, 1976, 1964);
{
printf("RYUJIN NO KEN WO KURAE!");
}
// snake
elseif(dateOfBirth == 2013, 2001, 1989, 1977, 1965);
{
printf("Orochimaru?");
}
// horse
elseif(dateOfBirth == 2014, 2002, 1990, 1978, 1966);
{
printf("NOW WATCH ME NE- No.");
}
// goat
elseif (dateOfBirth == 2015, 2003, 1991, 1979, 1967);
{
printf("Cheese.");
}
// monkey
elseif (dateOfBirth == 2016, 2004, 1992, 1980, 1968);
{
printf("You sure you're not genetically engineered...?");
}
// rooster
elseif (dateOfBirth == 2017, 2005, 1993, 1981, 1969);
{
printf("Who needs an alarm clock amarite?");
}
// dog
elseif (dateOfBirth == 2018, 2006, 1994, 1982, 1970);
{
printf("Haha, funny doggo!");
}
// pig
else (dateOfBirth == 2019, 2007, 1995, 1983, 1971);
{
printf("I don't even like bacon.");
}
system("pause");
}
I hope the code I included is correct, as in formatting.
Edit: elseif -> else if. Also no semicolon at the end of arguments, as well as adding "dateOfBirth ==" to each year, code now working fine thanks all for input especially @Vlad From Moscow!