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
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
What is I ++ in c programming?
What is external variable in c?
Do you know the purpose of 'register' keyword?
what are enumerations in C
What does typedef struct mean?
Is the exit() function same as the return statement? Explain.
Calculate 1*2*3*____*n using recursive function??
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
How many types of arrays are there in c?
What is meant by preprocessor in c?
What is a void pointer in c?
When the macros gets expanded?
What is data types?
What is an operator?