A. 1
- int main()
- {
- string str="gEsP is Interesting !";
- int x = str.length();
- int nwords = 0;
- or(int i = 0; i < x; i++)
- if (str[i]==' '){
- nwords++;
- while(str[++i]==' ') ;
- }
- cout << nwords << endl;
- cout << endl;
- return 0;
- }
B. 2
C. 3
D. 4