Home > OS >  Why isn't execute cycle and cout statement
Why isn't execute cycle and cout statement

Time:10-10

#include
using namespace std;
Int main ()
{
Int Spaces=0;
Int total=0;
char ch;
Cin. Get (ch);
While (ch! )
='. '{
If (ch=='\ 0')
+ + Spaces;
+ + total;
Cin. Get (ch);
}
Cout & lt; Cout<"Characters of total sentence in \ n";
return 0;
}


After the input string and press enter to exit the DOS window window didn't see the loop is executed and the back of the cout statement

CodePudding user response:

Because your character ch did not assign initial values

CodePudding user response:

Program runs out naturally out of the

return 0; Prefix getchar ();
  • Related