write a C program to find the length of the string
Answers
Answered by
1
Answer:
#include <stdio.h>
#include <string.h>
int main()
{
char a[100];
int length;
printf("Enter a string to calculate its length\n");
gets(a);
length = strlen(a);
printf("Length of the string = %d\n", length);
return 0;
}
Answered by
0
Answer:
#include<constream.h>
#include<string.h>
void main()
{
clrscr();
char a[20];
int l;
cout<<"\n Enter any name";
cin>>a;
l=strlen(a);
cout<<"\n Length of array:"<<l;
getch();
}
Similar questions