Count total character in a char array
#include <stdio.h> #include <ctype.h> int main()/* w ww . java 2 s . c om*/ { char phrase[] = "This is a Test"; int index; index = 0; while(phrase[index]) { index++; } printf("\"%s\"\n",phrase); puts("Statistics:"); printf("%d total characters\n",index); return(0); }