Variables used
a -Array
l -Lenth
i -Loop control
Program
#include<stdio.h>
#include<string.h>
main()
{char a[100];
int i,l=0;
printf("Enter the string");
gets(a);
for(i=0;a[i]!='\0';i++)
{l=l+1;
}
printf("The length=%d",l);
}
a -Array
l -Lenth
i -Loop control
Program
#include<stdio.h>
#include<string.h>
main()
{char a[100];
int i,l=0;
printf("Enter the string");
gets(a);
for(i=0;a[i]!='\0';i++)
{l=l+1;
}
printf("The length=%d",l);
}
No comments:
Post a Comment