Write a program that converts a string like "124" to an integer 124.
//C program that converts a string like "124" to an integer 124.
#include<stdio.h>
#include <stdlib.h>
int main()Â
{
  char strNum[10] = "124";//Numeric string
  Â
  int intNum = atoi(strNum);//Use atoi() to convert the string to numeric integer
  Â
  printf("The string %s string has been converted to %d integer", strNum, intNum); //Display the results
  return 0;
}
Comments
Leave a comment