Hi! I need help for my c++.
This is the code:
#include<iostream.h>
#include<conio.h>
void box(int x, int xx, int y, int yy);
void box(int x, int xx, int y, int yy)
{
int xs,ys,i,j;
xs=xx-x;
ys=yy-y;
for(i=1; i<xs; i++){gotoxy(x+i,y);cout<<"Í";
gotoxy(x+i,yy);cout<<"Í"; }
for(j=1; j<ys; j++){gotoxy(x,y+j);cout<<"º"; }
for(j=1; j<ys; j++){gotoxy(xx,y+j);cout<<"º"; }
{gotoxy(x,y);cout<<"É";
gotoxy(x,yy);cout<<"È";
gotoxy(xx,y);cout<<"»";
gotoxy(xx,yy);cout<<"¼";}
}
char ans;
char ask;
int life;
int main()
{
clrscr();
box(5,50,1,45);
box(55,78,8,30);
gotoxy(62,12);cout<<"LIFELINE";
gotoxy(57,15);cout<<"1. 50:50";
gotoxy(57,18);cout<<"2. Call a friend";
gotoxy(57,21);cout<<"3. Ask the audience";
gotoxy(13,3);cout<<"Who Wants to be a Millionaire?";
gotoxy(10,5);cout<<"The Folder contains?";
gotoxy(10,9);cout<<"a. Foods";
gotoxy(24,9);cout<<"b. Files";
gotoxy(10,11);cout<<"c. Animals";
gotoxy(24,11);cout<<"d. Clothes";
getch();
gotoxy(9,13);cout<<"Do you want to use your lifeline?";
gotoxy(13,14);cout<<" Y/N : ";
cin>>ask;
if(ask=='y')
{
gotoxy(10,15);cout<<"Choose Lifeline Number: ";
cin>>life;
if(life==1)
{
gotoxy(18,17);cout<<"[ 50:50 ]";
gotoxy(10,19);cout<<"_________";
gotoxy(24,19);cout<<"c. Animals";
gotoxy(10,21);cout<<"b. Files";
gotoxy(24,21);cout<<"_________";
}
else if(life==2)
{
gotoxy(18,17);cout<<"[ Call a friend ]";
gotoxy(10,20);cout<<"Friend: I think it is B";
getch();
gotoxy(10,23);cout<<"You: How sure are you?";
getch();
gotoxy(10,26);cout<<"Friend: I'm 95% sure about this.";
}
else if(life==3)
{
gotoxy(18,17);cout<<"[ Ask the audience ]";
gotoxy(10,23);cout<<"(a.) 23% (b.) 52% (c.) 13% (d.) 12%";
}
}
else if(ask=='n')
gotoxy(10,30);cout<<"Your answer is: ";
cin>>ans;
if(ans=='a' || ans=='A')
gotoxy(14,35);cout<<"Correct!";
gotoxy(10,38);cout<<"Get ready for the next round!";
else
gotoxy(14,35);cout<<"Wrong!";
gotoxy(10,38);cout<<"Play again?";
getch();
return 0;
}
The problem is when I try to run the program it says:
"ERROR Final.cpp 77: MISPLACED ELSE"
but i can't find if where is the error.
i'm so sorry, i'm not really good about this stuff. (^_^)