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 a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

3503


What is a null string in c?

589


Explain what are bus errors, memory faults, and core dumps?

792


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list

2239


What is meant by recursion?

632






Why is c not oop?

540


Is the exit() function same as the return statement? Explain.

665


Write a program to find the biggest number of three numbers in c?

589


State the difference between x3 and x[3].

652


how can use subset in c program and give more example

1502


How do you determine whether to use a stream function or a low-level function?

649


What is data structure in c and its types?

597


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

1984


what is ur strangth & weekness

1821


Tell us the use of fflush() function in c language?

641