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
How do you search data in a data file using random access method?
What's the difference between constant char *p and char * constant p?
Is null always defined as 0(zero)?
What is the meaning of 2d in c?
I have seen function declarations that look like this
Why c is known as a mother language?
What are the main characteristics of c language describe the structure of ac program?
What is a scope resolution operator in c?
How do you define a string?
What is the condition that is applied with ?: Operator?
How does #define work?
What does stand for?
What is f'n in math?
What are the application of c?
Can we add pointers together?