HELP PLEASE!!!

hi. i need help please. i just wrote a program that asks the user to type in three integers. now i have to write something that will end the program if the user types in three negative integers. i cant figure out how. my integers are declared using x, y, z. how can i write it. thank you.

If x,y and z, all need to be negative numbers at the same time, you could use

12

if (x<0 && y<0 && z < 0)
// use ending of program here

But, if it's just a negative number, entered 3 different times, then you could use a variable, named something like int Neg_Num = 0; the each time you check what the inputs are of x,y and z, add one to Neg_Num. Check if Neg_Num >= 3, and then the cancel program if it is.

Use something along these lines, as I show in this small program. Just incorporate this idea into yours. If you're still having problems, please post your code, and I/we, can better help you. And use the <> symbol in box at right to place your program in a code box to make it easier to read.

@whitenite1.
thank you so much but im not sure if i can use dataset yet because my prof hasnt taught it yet and i dont even know what that is. he is the type of guy that will take points off cause we didnt learn it yet. is there another way of doing this without dataset. thank you.

Dataset is just the name I gave the array. You haven't learned about arrays yet? The array was so you could show all the sets of numbers that were entered. I guess you don't really need that.
Anyway, I redid the program so as to NOT use an array. This is probably more of what you had in mind to begin with.