Sunday, February 15, 2009

Find the Length of and String Arry

#include
#include

void main()
{
int i;
char str[10];

printf("Enter sentence: ");
gets(str);

for(i=0;str[i]!='\0';i++)
{

}

printf("The length of the string is %d", i);
}

1 comments:

Maduka Jayalath said...

කෝඩ් ලියද්දි "indentation" තියල ලිව්වම තමයි කියවන්න පහසු වෙන්නේ.