can you tellme whats wrong with my program

please help me in the following program i've created header files for my self defined function its all well and good they r text graphic function but after i include more then 3 functions of zodiac the text style gets messed up and i can't read a thing please help me project is due 2morrow

#include
#include
#include
#include
#include
#include
#include
#include
#include
void main()
{
char ch;
int d,m,driver=VGA,mode=VGAHI;
clrscr();
initgraph(&driver,&mode,"D:\tc\bgi");
settextstyle(6,0,1);
moveto(20,10);
outtext("Enter the month and day of your birth");
gotoxy(41,2);
scanf("%d,%d",&m,&d);
if((m==3 && d>=21 ) || (m==4 && d<=20))
{
moveto(20,30);
outtext("Who works from morn to set of sun?");
moveto(20,50);
outtext("and never likes to be outdone");
moveto(20,70);
outtext("whose walk is almost like a run?");
moveto(20,90);
outtext("Who? Aries!");
moveto(20,110);
outtext("press enter to know more about aries or any other key to exit");
ch=getch();
if(ch=='
')
aries();
else
exit(0);
}
else if((m==4 && d>=21) || (m==5 && d<=22))
{
moveto(20,30);
outtext("who smiles through life-except when crossed?");
moveto(20,50);
outtext("who knows,or thinks he knows the most?");
moveto(20,70);
outtext("who loves good things: baked,boiled or roast");
moveto(20,90);
outtext("Oh. Taurus!");
moveto(20,110);
outtext("press enter to know more about taurus or any other key to exit");
ch=getch();
if(ch=='
')
taur();
else
exit(0);
}
else if((m==5 && d>=23 ) || (m==6 && d<=21))
{
moveto(20,30);
outtext("Who is fond of life and jest and pleasure?");
moveto(20,50);
outtext("who vacillates and changes ever?");
moveto(20,70);
outtext("who loves attention without measure?");
moveto(20,90);
outtext("Why Gemini!");
moveto(20,110);
outtext("press enter to know more about Gemini or any other key to exit");
ch=getch();
if(ch=='
')
gem();
else
exit(0);
}
else if((m==6 && d>=22) || (m==7 && d<=22))
{
moveto(20,30);
outtext("who changes like a changeful season?");
moveto(20,50);
outtext("holds fast and lets go without reason?");
moveto(20,70);
outtext("who is there that can give adhesion");
moveto(20,90);
outtext("to cancer?");
moveto(20,110);
outtext("press enter to know more about Cancer or any other key to exit");
ch=getch();
if(ch=='
')
can();
else
exit(0);
}
/*else if((m==7 && d>=23) || (m==8 && d<=22))
{
moveto(20,30);
outtext("who praises all his kindred do?");
moveto(20,50);
outtext("except his friends to praise him too");
moveto(20,70);
outtext("and cannot see their senseless view?");
moveto(20,90);
outtext("Ah. Leo!");
moveto(20,110);
outtext("press enter to know more about taurus or any other key to exit");
ch=getch();
if(ch=='
')
leo();
else
exit(0);
}
else if((m==8 && d>=23 ) || (m==9 && d<=22))
{
moveto(20,30);
outtext("who criticizes all she sees?");
moveto(20,50);
outtext("yes een would analyze a sneeze?");
moveto(20,70);
outtext("who hugs and loves her own disease?");
moveto(20,90);
outtext("humpf. Virgo!");
moveto(20,110);
outtext("press enter to know more about taurus or any other key to exit");
ch=getch();
if(ch=='
')
gem();
else
exit(0);
}
else if ((m==9 && d>23 ) || (m==10 && d<=22))
{
moveto(20,30);
outtext("who puts you off with promise gay?");
moveto(20,50);
outtext("and keeps you waiting half the day?");
moveto(20,70);
outtext("who compromises all the way?");
moveto(20,90);
outtext("Sweet Libra!");
moveto(20,110);
outtext("press enter to know more about taurus or any other key to exit");
ch=getch();
if(ch=='
')
gem();
else
exit(0);
}
else if((m==10 && d>=23) || (m==11 && d<=21))
{
moveto(20,30);
outtext("who keeps an arrow in the bow");
moveto(20,50);
outtext("and if you prod will let it go?");
moveto(20,70);
outtext("a fervent friend..a subtle foe.");
moveto(20,90);
outtext("Is Scorpio!");
moveto(20,110);
outtext("press enter to know more about taurus or any other key to exit");
ch=getch();
if(ch=='
')
gem();
else
exit(0);
}
else if((m==11 && d>=22 ) || (m==12 && d<=21))
{
moveto(20,30);
outtext("saggitarius");
moveto(20,110);
outtext("press enter to know more about taurus or any other key to exit");
ch=getch();
if(ch=='
')
gem();
else
exit(0);}
else if((m==12 && d>=22) || (m==1 && d<=19))
{
moveto(20,30);
outtext("capricorn");
moveto(20,110);
outtext("press enter to know more about taurus or any other key to exit");
ch=getch();
if(ch=='
')
gem();
else
exit(0);}
else if((m==1 && d>=20 ) || (m==2 && d<=18))
{
moveto(20,30);
outtext("aquarius");
moveto(20,110);
outtext("press enter to know more about taurus or any other key to exit");
ch=getch();
if(ch=='
')
gem();
else
exit(0);}
else if((m==2 && d>=19 ) || (m==3 && d<=20))
{
moveto(20,30);
outtext("pisces");
moveto(20,110);
outtext("press enter to know more about taurus or any other key to exit");
ch=getch();
if(ch=='
')
gem();
else
exit(0);
}
else
{
moveto(20,30);
outtext("Invalid day or month");
}
getch();
closegraph();

}

Comments

  • [blue]Your code is almost not readable. Use code tags when posting. Also, if adding headers causes problems, then these headers most likely has something 'bad' in them. On the first glance, 2 things:

    1. If you are using private headers - use it with "" and not <>:

    #include "can.h"

    2. Every good header file must have the guards against redefinitions - do all your headers have these guards? It should go like that (inside .H file):

    [code][red]
    #ifndef HEADERNAME_H
    #define HEADERNAME_H

    // All your header code here...

    #endif // HEADERNAME_H
    [/red][/code]
    [/blue]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion