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 are the parts of c program?
What is the use of c language in real life?
What is floating point constants?
What does 3 periods mean in texting?
Explain b+ tree?
Create a simple code fragment that will swap the values of two variables num1 and num2.
write a program to print largest number of each row of a 2D array
What is the difference between array and linked list in c?
Is this program statement valid? INT = 10.50;
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a
Tell me about low level programming languages.
what are non standard function in c
Why c is known as a mother language?
What is a program flowchart and explain how does it help in writing a program?