|
---|
|
---|
|
---|
C Program for String Length.
void main()
{
int i,c=0;
char a[50];
clrscr();
printf("OUTPUT\n");
printf("------");
printf("\n\n");
printf("Please Enter a String:\n");
printf("*********************");
scanf("%s",a);
for(i=0;a[i]!='\0';i++)
{
c=c+1;
}
printf("\n\n");
printf("Length Of The Given String is=%d\n",c);
printf("*****************************");
getch();
}
|
---|