You are given a null-terminated string that may contain:
Your task is to:
Do not use atoi(), strtol(), or similar built-in functions.
Example-1
Input: "123abc" Output: 123
Example-2
Input: "-45!" Output: -45
Example-3
Input: "42@#" Output: 42
Example-4
Input: "abc123" Output: 0
Example-5
Input: "+78x90" Output: 78
Test Cases
Test Results
Input
123abc
Expected Output
123