Examveda
Examveda

What will be the output of the following C function?
#include <stdio.h>
void reverse(int i);
int main()
{
    reverse(1);
}
void reverse(int i)
{
    if (i > 5)
        return ;
    printf("%d ", i);
    return reverse((i++, i));
}

A. 1 2 3 4 5

B. Segmentation fault

C. Compilation error

D. Undefined behaviour

Answer: Option A


This Question Belongs to C Program >> C Fundamentals

Join The Discussion

Related Questions on C Fundamentals