Start New Discussion within our Software Development Community

Using borlandc

#include <stdio.h>
#include <conio.h>
#include <dos.h>
#include <stdlib.h>
#include <iostream.h>
void main()
{
clrscr();
char x1,x2,name,add,email,occupation;
int age,cellno;

printf("\tWelcome");
printf("\n\tto");
printf("\n\tVideo City");
printf("\nMembership Registration");
printf("\n\t\tA.New");
printf("\n\t\tB.Old");
printf("\nChoose:");
cin>>x1;
clrscr();

	{
	if((x1=='a')||(x1=='A'))
	{
	printf("\nRegistration Form");
	printf("\nName:");
	scanf("%s",&name);
	printf("\nAdd:");
	scanf("%s",&add);
	printf("\nemail:");
	scanf("%s",&email);
	printf("\nAge:");
	scanf("%d",&age);
	printf("\nOccupation:");
	scanf("%s",&occupation);
	printf("\nCell No:");
	scanf("%d",&cellno);
	clrscr();
	printf("\nCongratulations");
	printf("\n Your now Member");
	printf("\nof Video City");
	}
	else if((x2=='b')||(x2=='B'))
	{
	printf("\nMode of Transaction");
	printf("\nE.Buy");
	printf("\nF.Rent");
	printf("\nG.Return");
	printf("\nChoose:");
	cin>>x2;
	clrscr();
	}

		{
		if((x2=='e')||(x2=='E'))
		printf("\nBuy");
		else if((x2=='f')||(x2=='F'))
		printf("\nRent");
		else if((x2=='g')||(x2=='G'))
		printf("\nReturn");
		else
		printf("Invalid Input");
		}
	else
	printf("Press any key");
}



getch();
}

My Code Is Above and I Always get a MISPLACED ELSE! Help Pls. Urgently~ Nid To Finish Today!!!!

If you indented and spaced your code properly like

if(etc)
{
   //code indented here
}

else if (etc)
{
   //code indented here
   if(etc)
   { 
       //code indented here
   }
}

else 
{

}

you'd probably notice it right away. Try that and see if you can find it and post back.

Also, your thread is no more urgent than anyone else's. Pleas of "urgent" in a thread title tend to get the thread ignored.

This article has been dead for over six months. Start a new discussion instead.