#include<stdio.h>
#include<stdlib.h>
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;
}
OUTPUT:
String value is 1245
Number is 1245
Let's connect think dots to code ...
#include<stdio.h>
#include<stdlib.h>
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;
}
OUTPUT:
String value is 1245
Number is 1245