C++ > Algorithms
Shows the number of wrods and characters entered
Shows the number of wrods and characters entered #include
#include
main() { int chcount=0; int wdcount=1; char ch; clrscr(); cout<<"\n \n This program will count the number of characters and words that u have entered"; cout<<"\n Type whaterver u like to followed by an enter ....\n\n"; while ((ch=getche())!='\r') { if(ch==' ') wdcount++; else chcount++; } cout<<"\n\n The number of words are : "<
C++ Codes
Algorithms
Beginners
Code Snippets
Graphics
Data Structures
Games
Mathematics
Miscellaneous