Multiple choice technology programming languages

Which is the correct syntax for the function gcvt() in C?

  1. char *gcvt(double value,int digit,char buf);

  2. char *gcvt(double value,int digit,char *buf);

  3. char *gcvt(double value,int digit,char *buf)

  4. char *gcvt(double value,int digit,char buf)

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

The standard C function gcvt converts a double-precision floating-point number to a string and stores it in a buffer. Its prototype requires a character pointer char *buf to store the string, and a semicolon at the end of the declaration.