/*PROGRAM TO FIND STRING LENGTH*/
#include<stdio.h>
#include<string.h>
#include<conio.h>
void main()
{
char a[100];
int length;
clrscr();
printf("Enter a string to calculate it's length\n");
gets(a);
length = strlen(a);
printf("Length of entered string is = %d\n",length);
getch();
}
Output:-
 |
| sk. |
No comments:
Post a Comment