Hello every one
.
.
recently i have written this code to count letters and words in the phrase that the user enter , it worked once but when deleted (by mistake) and tried to rewrite it again it didn't work , so could you please help me to find out why it's not working ?
.
.
.
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int chcount=0;
int wdcount=1;
char ch;
cout<<"Enter A Phrase:";
while((ch = getche()) !='/r')
{
if(ch==' ')
wdcount++;
else
chcount++;
}
cout<<"\nWords = "<<wdcount<<endl;
cout<<"Letters = "<<chcount<<endl;
system("pause");
return 0;
}