I don’t know where im doing wrong here. its giving me total no. of chars but not the no. of words
Related to homework given . number of words
#include using namespace std; int main() { char ch; cin.get(ch); int i = 0; while (ch != ‘$’) { if(ch == ’ ’ || ‘.’ || ‘,’) { i++; } } cout << i; return 0; }