Home » C Programming » Functions » Question
  1. What will be the output of the following C code?
    #include <stdio.h>
    #include <stdarg.h>
    void function(int, ...);
    int main()
    {
    function(21, 13, 15, 17, 101, 113);
    return 0;
    }
    void function(int n, ...)
    {
    int num, k = 0;
    va_list start;
    va_start(start, n);
    while (k != 5)
    {
    num = va_arg(start, int);
    k++;
    }
    printf("%d", num);
    }
    1. 13
    2. 15
    3. 17
    4. 101
    5. 113
Correct Option: E

113



Your comments will be displayed only after manual approval.