### Unable to print my cout

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126`` ``````#include using namespace std; void introduction(); bool aretheyvalid(int x, int y , int z); void aretheysame(int x,int y ,int z); int roundscore(int); int main() { int numgroups=0; int validgroups=0; int invalidgroups=0; int score1, score2, score3; char answer; introduction(); do { cout<<"Type in the student's three scores from 0 to 100"<>score1; cin>>score2; cin>>score3; if (aretheyvalid(score1, score2, score3)==true) { validgroups++; cout << "the grades are valid" <>answer; cout<= 0 && x && y && z <= 100) ans=true; else { ans= false; if (x < 0) cout<< x << " is too small" << endl; if (y < 0) cout<< y << " is too small" << endl; if (z < 0) cout<< z << " is to small" << endl; if (x >100) cout<< x << " is too big" << endl; if (y > 100) cout<< y << " is too big" << endl; if (z > 100) cout<< z << " is too big" << endl; } invalid++; return ans; return invalid; } void aretheysame(int x, int y, int z) //this is the part where I can't get any of the couts to my print screen. { if(x== y&&y == z) cout<<"all three numbers are the same"<= 5) score = score + (10-r); else score = score - r; return score; } ``````
Can you tell more :

1- What's wrong? Output, Result,....
2- Description?
4- Where your doubt is... (important)

Hope this helps.
Last edited on
Remember that the do while loop states that if you type 'y' to continue, it will start the loop again, not actually continue through the program. Pressing the 'n' should exit the loop and print what you wrote in your function.

Your program will end straight away though since nothing is stopping it from closing, which means you won't even have enough time to see what prints.

`system("pause");`
before
`return 0;`

so that you can actually see what happens before it closes.

Also, you should check your logic from the function 'aretheysame'. At first glance it looks like it will say "All values are different" even if two are the same. Have a play around with your if statements to see if you can get it working correctly
Yeah I fixed the statements for the aretheysame and it works. Thanks!
Topic archived. No new replies allowed.