length of a string
#include<stdio.h>
#include<conio.h>
#include<string.h>

void main()
{
char str[10],length,i=0;
clrscr();
printf("\nenter the string");
gets(str);
while(str[i]!='\0')
i++;
length = i;
printf("\n the lenght of string %d",length);
getch();
}
0 comments:
Post a Comment