plz answer.. a program that takes a string e.g. "345" and
returns integer 345

Answer Posted / swapnil chhajer

#include<stdio.h>
#include<stdlib.h>

int main()
{
char str[10];
printf("Enter the string : ");
gets(str);
printf("Converted integer : %d",atoi(str));
getchar();
}

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does *p++ do? What does it point to?

606


What is the difference between union and structure in c?

562


What is the use of a static variable in c?

582


How can you pass an array to a function by value?

593


What is wrong with this code?

683






how do you execute a c program in unix.

630


the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above

597


Explain zero based addressing.

596


"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks

648


What are the valid places to have keyword “break”?

642


What is keyword in c?

586


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

1482


How can I insert or delete a line (or record) in the middle of a file?

564


how can f be used for both float and double arguments in printf? Are not they different types?

600


in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures

670