how to find string length wihtout using c function?

Answer Posted / ruchi

#include<conio.h>
#include<stdio.h>
int main()
{
char a[10];
int i=0,c,length=0;
printf("\nEnter the string ");
while((a[i++]=getchar())!='\n');
printf("\nThe lengh of the string is ");
i=i-1;
printf("%d",i);
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is structure data type in c?

569


formula to convert 2500mmh2o into m3/hr

496


How do you view the path?

669


What is the role of && operator in a program code?

566


hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .

1901






Explain what is meant by high-order and low-order bytes?

634


What is define c?

574


Explain how can you tell whether a program was compiled using c versus c++?

578


while initialization of array why we use a[][2] why not a[2][]...?

1863


What are linked lists in c?

651


What is volatile variable how do you declare it?

566


What is the difference between procedural and declarative language?

651


What is static memory allocation? Explain

632


What is realloc in c?

581


What is pass by reference in functions?

323