c - Combine an if statement with do while -


I am finishing a small game where the first task is to do what Input & gt; 0 or Input & lt; 23

  integer height; Do {printf ("height:"); Height = getInt (); } While ((height & lt; = 1) || (height> 23;));   

This works when you write a value that is not in accordance with the statement, you have to type a new one, though I would like to include a statement in a way: < / P>

  if (the situation is not true) {printf ("fill a number between 1-23!"}}   

but it can not work Any clues on doing wrong?

Invert type:

  Inti height = -1; // DEFAULT VALUE me (when height> 23)) ((height> 23)) // Enter a number between about acceptable class play in print value message ( "1 -23"); // Read an altitude = GetInt (); Printf ("Height:"); }    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -