In C++ Program you can write a code to count the characters of the word entered. Let's look at the coding.
C++ Program to count the number of characters entered
#include <iostream.h>
#include <conio.h>
int main ()
{
int chcount = 0 ;
const char ent = '\n' ;
char ch ;
std::cout << "Enter character\n" ;
std::cin.get(ch) ;
while (ch!=ent)
{
chcount++ ;
std::cout.put(ch) ;
std::cin.get(ch) ;
}
std::cout <<"\n The number of characters = " <<chcount <<"\n" ;
return 0 ;
}
The output of the C++ Program Code