Home » C Programming » Functions » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    #include <stdarg.h>
    int function(int n, ...);
    int main()
    {
    int n = 102;
    float f = 105;
    function(n, f);
    return 0;
    }
    int function(int n, ...)
    {
    va_list list;
    va_start(list, n);
    float f = va_arg(list, float);
    printf("%f\n", f);
    va_end(list);
    }
    1. f
    2. 102
    3. 105
    4. i
    5. Undefined behaviour
Correct Option: E

Undefined behaviour



Your comments will be displayed only after manual approval.