Skip to main content

Sample C Program To Convert String To An Integer Using atoi() Function.

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
int main()

int i;
i = atoi(" 100");

printf(" The integer value is: %d ", i);

return 0;



The integer value is: 100


If you liked the post/article or if you think this post/article helped you in any way, then please show your appreciation by filling up at least one form from the options given below:

-- Click Here To Win Rewards Each Time When You Access Internet.

-- Click Here To Add The Best Online Dictionary Resources... Right To Your Browser.

-- Click Here To Instantly Check All Your Webmail Accounts... Right From Your Browser.

-- Click Here To Get Up To 40% Off On Your Favorite Books.

-- Click Here To Register In AllSchoolStuff - Helping Parents Buy School & Learning Products.

-- Click Here To Apply To Multiple Colleges With A Single Application.

-- Click Here To Register In SwarnIQ - A Social Reading Experience.

-- Click Here To Win Rewards, Cash, Shopping Vouchers & Exciting Gifts For Completing Surveys.

-- Click Here To Submit Your Resume - TimesJobs (Freshers & Experienced)

-- Click Here To Submit Your resume - Shine (Freshers & Experienced)


  1. The ? Is convert string to integer but where is the string declaration . . .

    1. i = atoi(" 100");

      100 which is inside quatation

  2. The ? Is convert string to integer but where is the string declaration . . .

    1. anything inside double quote is string.
      so "101" is a string
      if u want to mention explicitly u can have
      char str[]="101";

  3. char str[100];

    will do it
    actually anything within double quotes is STRING
    atoi("101") where 101 is a string

  4. What is atoi()?

    1. itz converting from an ascii value to integer value

  5. a denotes alphabet(a) to integer(i)


Post a Comment

Please share your opinions and suggestions or your experience in the comments section. This way we can all help each other...

Experienced guys can share their resumes at

Popular posts from this blog

Tell Me Something About Yourself - Interview Answers.

Try to introduce some of your most important employment-oriented skills as well as your education and accomplishments to the interviewer. Answer to this question is very important because it positions you for the rest of the interview. That's why this statement is often called the "Positioning Statement".

One should take the opportunity to show his/her communication skills by speaking clearly and concisely in an organized manner. Since there is no right or wrong answer for this question hence it is important to appear friendly.


1) I am a person with strong interpersonal skills and have the ability to get along well with people. I enjoy challenges and looking for creative solutions to problems.

2) Besides the details given in my resume, I believe in character values, vision and action. I am quick in learning from mistakes. I am confident that the various tests that you have conducted will corroborate my competencies aptitude and right attitude for the…

100 C Programs Frequently Asked in Technical Interview.

100 C++ Programs Frequently Asked in Technical Interview.