how to find string length wihtout using c function?

Answers were Sorted based on User's Feedback



how to find string length wihtout using c function?..

Answer / ivr

char *a="india";
for(i=0;a[i]!='\0';i++);
printf("the length is :%d",i);

Is This Answer Correct ?    10 Yes 1 No

how to find string length wihtout using c function?..

Answer / 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

how to find string length wihtout using c function?..

Answer / 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

how to find string length wihtout using c function?..

Answer / ankitecian

int StrLen(const char *_input)
{
int _len = 0;
while( *(_input + _len) != NULL)
{
_len++;
}
return _len;
}

Is This Answer Correct ?    1 Yes 0 No

how to find string length wihtout using c function?..

Answer / 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

how to find string length wihtout using c function?..

Answer / ramesh

# include <stdio.h>
# include <conio.h>

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

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

what is ANSI and ISO

7 Answers   HCL,


What is the meaning of 2d in c?

0 Answers  


Convert the following expression to postfix and prefix (A+B) * (D-C)

3 Answers   Satyam,


suppose we use switch statement and we intilize years name using enum statement like(jan,feb,mar,------dec) we take integer value as an input .question is that the month which we analyz is from 0 to 11 bt if i enter 12 than how he again starts from begning and print jan

1 Answers  


i want to make a program in which we use input having four digits(4321) and get output its reciprocal(1234).

1 Answers  






main() { char p[] = "hello world!"; p = "vector"; printf("%s",p); }

2 Answers   Vector, Vector India,


write a C program, given number is double without using addt ion and multiplication operator?ex:n=6,ans=12,pls send me ans to goviseenu@gmail.com

6 Answers  


What are the types of bitwise operator?

0 Answers  


Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.

0 Answers  


What is key word in c language?

4 Answers   ABC,


What does c mean in basketball?

0 Answers  


2. What does static variable mean?

2 Answers  


Categories