Where i am wrong?

#include
using namespace std;
int main()
{
int digits = 0;
int alphabets = 0;
int spaces = 0;
int other = 0;

char ch;
cin>>ch;
while(ch!=’$’)
{
if(ch>='0’and ch<= ‘9’)
{
digits++;
}
else if( (ch >='a’and ch <=‘z’) or ( ch>=‘A’ and ch<=‘Z’))
{
alphabets++;
}

else if (ch==’ ’ or ch ==’\n’ or ch==’\t’)
{
spaces++;
}
else
{
other++;
}
cin>>ch;
}
cout<<“digits=”<<digits<<endl;
cout<<“alphabets=”<<alphabets<<endl;
cout<<“spaces =”<<spaces<<endl;
cout<<“Other =”<<other<<endl;
return 0;
}

save your code at


and send link of code
don’t paste code from here it will create errors

#include using namespace std; int main() { int digits = 0; int alphabets = 0; int spaces = 0; int other = 0; char ch; cin>>ch; while(ch!=’$’) { if(ch>=‘0’and ch<= ‘9’) { digits++; } else if( (ch >=‘a’and ch <=‘z’) or ( ch>=‘A’ and ch<=‘Z’)) { alphabets++; } else if (ch==’ ’ or ch ==’\n’ or ch==’\t’) { spaces++; } else { other++; } cin>>ch; } cout<<“digits=”<<digits<<endl; cout<<“alphabets=”<<alphabets<<endl; cout<<“spaces =”<<spaces<<endl; cout<<“Other =”<<other<<endl; return 0; }

please save your code at

paste your code there (Not from here)
click on file–> save–> link generated at top

share this link here

link look like https://ide.codingblocks.com/s/254441

you have to do this so that i can compile and rectify your code