| epenganteng (6) | |||
hi guys,the code above needs to be limited,how to make it "When we put the number larger than 99,the exe will close,or show some text : YOU PUT WRONG VALUE!",how?? tq :) | |||
|
|
|||
| NwN (770) | |||
It's in this block that you're asking for input, so it would make sense to put the validation here. The easiest way is probably: * make temporary int * cin >> temp_int * if tmp_int is larger than 99, decrease the counter (a) by 1 and continue to the next iteration * else, set Array[a] = temp_int That should provide you all the info you need to get that sorted. Please do let us know if you require any further help. All the best, NwN | |||
|
|
|||
| epenganteng (6) | |
| @NwN please put in one @code so all done,this is my assignment for 1 week :) | |
|
|
|
| MikeyBoy (235) | ||
That's your job. We're not here to do your homework for you. We'll give advice on C++ issues, and we'll take a look at code to see where problems are. We're not going to write it for you. | ||
|
|
||