Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to generate the length of a string without using len
funtion?

Answer Posted / poornima

#include<stdio.h>
int strlength(char *);
int main()
{
char *str;
int len;
printf("Enter a string : ");
gets(str);
len=strlength(str);
printf("Length of %s is %d",str,len);
return 0;
}
int strlength(char *str)
{
int len=0;
for(;*str!='\0';str++)
{
len++;
}
return len;
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we assign integer value to char in c?

1153


Wt are the Buses in C Language

3149


What is hashing in c?

1095


Explain #pragma statements.

978


The statement, int(*x[]) () what does in indicate?

1078


Explain 'bit masking'?

1022


Are there constructors in c?

969


write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1

3856


What are the modifiers available in c programming language?

1172


How is pointer initialized in c?

975


What do you mean by dynamic memory allocation in c?

1045


What does 2n 4c mean?

1176


How would you use the functions fseek(), freed(), fwrite() and ftell()?

1099


Is there a way to compare two structure variables?

1053


What is difference between static and global variable in c?

977