Back To C++ Single Dimensional Arrays Index
//program to input a character array or string from user and find its length using while loop #include
#include
void main() { char name[20]; int i=0; clrscr(); printf("enter your name"); gets(name); while(name[i]!='\0') { i++; } printf("length of string is %d",i); getch(); }