Join Examsbook
873 0

Q: What do the functions atoi(), itoa() and gcvt () do? Show how would you use them in a program.

  • Show AnswerHide Answer
  • Workspace

Answer :
Explanation :

atoi()         Converts a string to an integer. itoa()         Convert an integer to a string gcvt()        Converts a floating-point number to a string   #include "stdlib.h" main() {       char s[] = "12345";       char buffer [15], string[20];       int i;              i = atoi (s);       printf("\n%d",i);          gcvt (20.141672, 4, buffer);        printf ("\n%s", buffer);          itoa(15, string,2);         printf ("\n%s", string); }

Are you sure

  Report Error

Please Enter Message
Error Reported Successfully