"Write a C program that prompt the user for his or her date of birth,
before determining his or her Western Zodiac Sign.
The program must remain in an infinite loop
(prompt the user for his or her date of birth again, after each display of the previous result)
until a unique key is pressed, indicating that the user wishes to exit the program."
I am not sure that I have all the components in for I still don't get this course. Here is what I have. Can someone look at it and give some advice in what I should do for next?
thanks.
#include<stdio.h>
void main()
{
int month;
int day;
int WZS(int day,int month);
printf("Please enter your month of birth:\n");
scanf("%d",&month);
printf("Please enter your day of birth:\n");
scanf("%d",&day);
do
{
if((day>=22)&&(day<=31)&&(month==12))
printf("Your western zodiac sign are Capricorn\n");
else if((day>=1)&&(day<=20)&&(month==1))
printf("Your western zodiac sign are Capricorn\n");
else if((day>=21)&&(day<=31)&&(month==1))
printf("Your western zodiac sign are Aquarius!\n");
else if((day>=1)&&(day<=21)&&(month==2))
printf("Your western zodiac sign are Aquarius\n");
else if((day>=22)&&(day<29)&&(month==2))
printf("Your western zodiac sign are Pisces\n");
else if((day>=1)&&(day<=21)&&(month==3))
printf("Your western zodiac sign are Pisces\n");
else if((day>=22)&&(day<=31)&&(month==3))
printf("Your western zodiac sign are Aries\n");
else if((day>=1)&&(day<=20)&&(month==4))
printf("Your western zodiac sign are Aries\n");
else if((day>=21)&&(day<=30)&&(month==4))
printf("Your western zodiac sign are Taurus\n");
else if((day>=1)&&(day<=21)&&(month==5))
printf("Your western zodiac sign are Taurus\n");
else if((day>=22)&&(day<=31)&&(month==5))
printf("Your western zodiac sign are Gemini\n");
else if((day>=1)&&(day<=21)&&(month==6))
printf("Your western zodiac sign are Gemini\n");
else if((day>=22)&&(day<=30)&&(month==6))
printf("Your western zodiac sign are Cancer\n");
else if((day>=1)&&(day<=22)&&(month==7))
printf("Your western zodiac sign are Cancer\n");
else if((day>=23)&&(day<=31)&&(month==7))
printf("Your western zodiac sign are Leo\n");
else if((day>=1)&&(day<=22)&&(month==8))
printf("Your western zodiac sign are Leo\n");
else if((day>=23)&&(day<=31)&&(month==8))
printf("Your western zodiac sign are Virgo\n");
else if((day>=1)&&(day<=22)&&(month==9))
printf("Your western zodiac sign are Virgo\n");
else if((day>=23)&&(day<=30)&&(month==9))
printf("Your western zodiac sign are Libra\n");
else if((day>=1)&&(day<=23)&&(month==10))
printf("Your western zodiac sign are Libra\n");
else if((day>=24)&&(day<=31)&&(month==10))
printf("Your western zodiac sign are Scorpio\n");
else if((day>=1)&&(day<=21)&&(month==11))
printf("Your western zodiac sign are Scorpio\n");
else if((day>=22)&&(day<=30)&&(month==11))
printf("Your western zodiac sign are Sagittarius\n");
else if((day>=1)&&(day<=21)&&(month==12))
printf("Your western zodiac sign are Sagittarius\n");
else
printf("Wrong data!\n");
} while(WZS!=e);
}

New Topic/Question
Reply



MultiQuote


|