Original Post
Hey I'm having a little problem, im trying to make a program to help better understand functions and in this program I need a function to take 2 variables and divide them, if the 2nd number is bigger it should return a -1 , else It should return the value. I'm just having a little problem that I can't figure out. Here is the code #include #include int divison(int x, int y); int main() { int x,y; int var; cout << " Please give me 2 numbers, make the 1st greater then the 2nd.\n"; cout << " Please input the 1st number " <<"\n"; cin >> x; cout << " Please input the 2nd number " <<"\n"; cin >>y; var= division(int x, int y); if (var = -1) cout << "Hey your 2nd number was bigger...\n"; else cout << "Number 1 divided by number 2 = "<y) return (x/y); else return ( -1); } So yea I don't know what it is. Do I have to set a value for what is going to be returned, because I will have to display that value. That is what the variable var is intented to do , but it seems to not like that. Any help would be greatly appeciated. Happy coding Glyvin Edit(I changed it now im just getting a Phrase error on line 14