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...

plz answer.. a program that takes a string e.g. "345" and
returns integer 345

Answer Posted / ramu

int f(char s[])
{
int num=0,i;
for(int i=0;s[i]>='0' && s[i]<='9';i++)
n=10*n+(s[i]-'0');
if(i<sizeof(s))
{
printf("Error String");
return 0;
}
return n;
{

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is sprintf unsafe?

1089


What does static variable mean in c?

1116


What is function pointer c?

1124


What does the message "automatic aggregate intialization is an ansi feature" mean?

1200


How to Throw some light on the splay trees?

1075


Is this program statement valid? INT = 10.50;

1171


a value that does not change during program execution a) variabe b) argument c) parameter d) none

1248


What tq means in chat?

1134


What is 02d in c?

1082


What are the features of c language?

1079


What is a nested loop?

1144


Is array name a pointer?

1039


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1654


Tell us the use of fflush() function in c language?

1165


What is the use of extern in c?

1100