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
Why is sprintf unsafe?
What does static variable mean in c?
What is function pointer c?
What does the message "automatic aggregate intialization is an ansi feature" mean?
How to Throw some light on the splay trees?
Is this program statement valid? INT = 10.50;
a value that does not change during program execution a) variabe b) argument c) parameter d) none
What tq means in chat?
What is 02d in c?
What are the features of c language?
What is a nested loop?
Is array name a pointer?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
Tell us the use of fflush() function in c language?
What is the use of extern in c?