Home > Back-end >  What's the problem with this c program? Enter the characters and Numbers but then I have no ref
What's the problem with this c program? Enter the characters and Numbers but then I have no ref

Time:09-24

#include
using namespace std;
Int main ()
{
char c;
Cout & lt; <"Both Please input some charactors: \ n";
Cin & gt;> c;
Int letters=0, space=0, digit=0, others=0;
While (c! )
='\ n'{
If (c & gt;='a' & amp; & C & lt;='z' | | c & gt;='A' & amp; & C & lt;='Z')
Letters++;
Else if (c==' ')
Space++;
Else if (c & gt;='0' & amp; & C & lt;='9')
Digit++;
The else
Others++;
}
Cout & lt; <"Char=" & lt; }

CodePudding user response:

What do you mean to repeat input till the end of input enter?
Cin & gt;> c; Not in the loop,

CodePudding user response:

Cin read carriage returns and Spaces
  • Related