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

** same as above.. only u should initialise the valued of
varibale len to 0..
otherwise it will pick up some garbage value.. **


int strlength(char s[])
{
int i , len;

len = 0;
for(i = 0 ; s[i] != '/0' ; i++)
{
len++;
}

return len;
}

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does this code crash?

1085


What is data structure in c programming?

1073


What is action and transformation in spark?

1159


Explain about C function prototype?

1083


Which programming language is best for getting job 2020?

1048


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

997


Explain the difference between malloc() and calloc() in c?

1042


What do you mean by dynamic memory allocation in c? What functions are used?

1160


How can I read in an object file and jump to locations in it?

1026


What are linker error?

1088


how to introdu5ce my self in serco

2003


What is pointer to pointer in c?

1104


What is the advantage of using #define to declare a constant?

1093


Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?

1044


Explain how does flowchart help in writing a program?

1113