how to find string length wihtout using c function?

Answer Posted / j.j.anand kamlesh

void main()
{
int i;
char ch[100];
printf("ENTER THE STRING :");
gets(ch);
for(i=1;ch[i];i++);
printf("THIS IS THE LENGTH : %d",i);
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the best way to comment out a section of code that contains comments?

784


Write a program for Overriding.

688


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

631


in linking some of os executables are linking name some of them

1651


Why is this loop always executing once?

617






What is advantage of pointer in c?

695


write a programming in c to find the sum of all elements in an array through function.

1708


application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above

606


Do variables need to be initialized?

621


Why do we use int main?

610


Is there any demerits of using pointer?

631


What does. int *x[](); means ?

638


 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

1728


Explain the difference between exit() and _exit() function?

634


What is typedef example?

616