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 scope and lifetime of a variable in c?

582


Is it better to use malloc() or calloc()?

652


What is #pragma statements?

594


What does emoji p mean?

610


When should a type cast be used?

577






What is the difference between union and structure in c?

581


Explain indirection?

650


hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?

1667


What is return type in c?

643


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

1805


What are the usage of pointer in c?

708


define string ?

671


Explain how do I determine whether a character is numeric, alphabetic, and so on?

656


Why we write conio h in c?

569


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

646