Thread: C++ Help
View Single Post
Old 10-7-2005, 02:43 PM   #40
chickendude
Away from Computer
FFR Simfile AuthorFFR Veteran
 
chickendude's Avatar
 
Join Date: Sep 2003
Location: Massachusetts
Age: 35
Posts: 1,901
Send a message via AIM to chickendude
Default Re: RE: Re: RE: Re: C++ Help

Code:
#include <iostream>
main()
{
 using std::namespace
 int x,y;

 cout << "enter an x and a y \n";
 cin >> x >> y;
 if (x==0 && y==0)
    cout << "origin";
 if (x==0 && y!=0)
    cout << "y-axis";
 if (y==0 && x!=0)
    cout << "x-axis";
 if (x > 0 && y > 0)
    cout << "first quadrant";
 if (x < 0 && y > 0)
    cout << "second quadrant";
 if (x<0 && y<0)
    cout << "third quadrant";
 if (x>0 && y<0)
    cout << "fourth quadrant" ;
}
ok stupid conditionals parentheses >_<
silly me
anyway, even though its too late I feel the need to fix it

you can do a main without a return I believe.
__________________
chickendude is offline   Reply With Quote