how to find string length wihtout using c function?

Answer Posted / vignesh1988i

#include<stdio.h>
#include<conio.h>
int str_len(char *)
void main()
{
char s[30];
int count;
printf("enter the string :");
gets(s);
count=str_len(s);
printf("the length is :%d",count);
getch();
}
int str_len(char *a)
{
int i=0;
while(*a!='\0')
a++;
i++;
}
return i;
}

thank u

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write the test cases for checking a variable having value in range -10.0 to +10.0?

2113


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1455


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

942


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

1172


Is it possible to execute code even after the program exits the main() function?

1109


about c language

1823


What does it mean when the linker says that _end is undefined?

890


how many key words availabel in c a) 28 b) 31 c) 32

856


Explain what are the __date__ and __time__ preprocessor commands?

897


What are global variables?

897


What is a node in c?

771


What is declaration and definition in c?

784


What is the value of a[3] if integer a[] = {5,4,3,2,1}?

896


Can a local variable be volatile in c?

793


What is the function of this pointer?

929