Use of atoi


  ****PROGRAM**** 


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

void main()
{
   int a;
   char s[20];
   strcpy(s, "1111111");
   a= atoi(s);
   printf("\n String is  = %s,   \nstring in integer is = %d", s, a);
   strcpy(s, "spccprogramming.blogspot.in");
   a= atoi(s);
   printf("\nString value = %s, \n Integer value is = %d\n", s , a);
}

OUTPUT:

String is  = 1111111,   
string in integer is = 1111111
String value = spccprogramming.blogspot.in, 
 Int value = 0

Comments