#include<stdio.h>
#include<conio.h>
void main()
{
char s[20];
int m;
clrscr();
printf("enter a string..");
gets(s);
for(m=0;s[m]!='\0';m++);
printf("\nlength of your string is:%d\n",m+1); /*last character is a null character */
getch();
}
#include<conio.h>
void main()
{
char s[20];
int m;
clrscr();
printf("enter a string..");
gets(s);
for(m=0;s[m]!='\0';m++);
printf("\nlength of your string is:%d\n",m+1); /*last character is a null character */
getch();
}
No comments:
Post a Comment