What is wrong with this program?
cout<<"Enter a string upto 99 characters(spaces included):"<<endl;
void count(char s)
int words=0, sentences=0;
if(s[i]=='?' || s[i]=='.' || s[i]=='!')
cout<<"The number of words you entered is/are:"<<words+1<<endl;
cout<<"The number of sentences you entered is/are:"<<sentences<<endl;
} The thing is, when I don't create a prototype of count and straightaway define it before void main() my program runs, but it gives error in this program that "extra parameter in call to count()"
BUT WHAT TO DO THEN?
You have to create a prototype before your main function.You can't call someone who doesn't exist this is the thing here. You have to create the function before you call it. You can go without writing the prototype , if you declare your whole count function before your main function.