C-Programs
Tuesday, 5 September 2017
C-Program to know the length of a string without using string functions
#include<stdio.h>
int main()
{
char str[100];
int i,len=0;
printf("Enter a string to know the length\n");
scanf("%s",&str);
for(i=0;str[i]!='\0';i++)
{
len++;
}
printf("The length of %s is %d\n",str,len);
return 0;
}
1 comment:
Unknown
11 January 2021 at 15:21
What's the output
Reply
Delete
Replies
Reply
Add comment
Load more...
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
What's the output
ReplyDelete