Search (Article Or Program)

18 June 2011

Character Count (in C)

//character count
#include
#include
main()
{
int count=0;
clrscr();
printf("\n\t\t >>>>>>>>>>>>>>>>>>>Character Count <<<<<<<<<<<<<<<<<<\n\n");
printf("\n\nType in a phrase : ");
while(getche()!='\r')
count++;
printf("\n\nCharacter count is %d : ",count);
getch();

}