C program to convert string into integer using atoi() function.


int main()
 char str[] = "1245";
 int n;
 n = atoi(str);
 printf("String value is %s \n",str);
 printf("Number is %d \n",n);

 return 0;

String value is 1245
Number is 1245

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *

The reCAPTCHA verification period has expired. Please reload the page.