string to int java
#include <stdio.h>
#include <stdlib.h>
int main() {
char str[] = "12345"; // Step 1: Declare and initialize a string
int result = atoi(str); // Step 2: Use atoi function to convert string to integer
printf("The integer value is: %d\n", result); // Step 3: Print the converted integer
return 0; // Step 4: Return 0 to indicate successful execution
}