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
What is huge pointer in c?
What’s a signal? Explain what do I use signals for?
What will be the outcome of the following conditional statement if the value of variable s is 10?
How can you find the exact size of a data type in c?
What is getch () for?
Why main function is special give two reasons?
Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer
Difference between Function to pointer and pointer to function
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0
What is the return type of sizeof?
What is #include conio h?
What is LINKED LIST? How can you access the last element in a linked list?
What is an endless loop?
How can I get back to the interactive keyboard if stdin is redirected?
What is the use of function overloading in C?