Join Examsbook
730 0

Q: Point out the error, if any, in the following program. #include "stdarg.h" main() {      display ( 4, 12.5, 13.5, 14.5, 44.3); } display(int num, ...) {        float c; int j;         va_list ptr;         va_start (ptr, num);         for ( j = 1; j <= num; j++)         {             c = va_arg ( ptr, float );             printf ("\n%f", c);          } }

  • Show AnswerHide Answer
  • Workspace

Answer :
Explanation :

While extracting a float argument using va_arg we should have useed  c = va_arg (ptr, double)

Are you sure

  Report Error

Please Enter Message
Error Reported Successfully