Multiple choice

The library function ‘atoi’ converts a _____.

  1. floating function into an integer

  2. string into an integer

  3. fraction into an integer

  4. decimal into an integer

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The atoi() function in C/C++ stands for ASCII to Integer and converts a string representation of a number to its integer equivalent. It parses the input character by character until it encounters a non-digit character, then returns the converted integer value. This is a fundamental function for handling numeric input stored as text.