English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

make a program that will input xcoordinate,ycoordinate,quadrants and results by using function..

this is the given program but it had a problem.. it is lacking..

#include
getXcoordinate()
getYcoordinate()
getQuadrant()
displayQuadrant()

main()
{
getXcoordinate();
getYcoordinate();
getQuadrant();
displayQuadrant();
}
getXcoordinate();
{
printf();
scanf();
return ();
}

getYcoordinate();
{
printf();
scanf();
return ();
}


what's the next???
by getting quadrants, we used
if(x>0&&y>0)
q=1;

after getting quadrants?? what will be the next???

the error when i compile this program is "getYcoordinate" there is something with it...



please help me

2007-12-12 11:15:14 · 2 answers · asked by ChArMz_aThEnA 1 in Computers & Internet Programming & Design

2 answers

Your prototypes at the top need semi-colons and then your function definitions below main, take off the semi colon at the beginning of each function. That should make a big difference.

If you have questions feel free to ask directly.

2007-12-12 11:24:29 · answer #1 · answered by Joe 2 · 0 0

Hi,
Try this:
----------------------------------------------------------------
#include
#include

int getXcoordinate();
int getYcoordinate();
void getQuardant(int,int);

void main()
{
int x,y;

clrscr();
x=getXcoordinate();
y=getYcoordinate();
getQuardant(x,y);
getch();
}

int getXcoordinate()
{
int x;
printf("\nEnter X coordinate: ");
scanf("%d",&x);
return(x);
}

int getYcoordinate()
{
int y;
printf("\nEnter Y coordinate: ");
scanf("%d",&y);
return(y);
}

void getQuardant(int x,int y)
{
clrscr();
if(x>0 && y>0) printf("Points (%d,%d) will lie in first quadrant.",x,y);

if(x<0 && y>0) printf("Points (%d,%d) will lie in second quadrant.",x,y);

if(x<0 && y<0) printf("Points (%d,%d) will lie in third quadrant.",x,y);

if(x>0 && y<0) printf("Points (%d,%d) will lie in fourth quadrant.",x,y);
}
------------------------------------------------------------------------------------

2007-12-13 00:35:42 · answer #2 · answered by iqbal 4 · 0 0

fedest.com, questions and answers