Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Cpp Programming Quiz 188 – What will be the output of the following program?

Question: What will be the output of the following program?

#include
struct IndiaBix
{
int arr[5];
public:
void BixFunction(void);
void Display(void);
};
void IndiaBix::Display(void)
{
for(int i = 0; i < 5; i++) cout<< arr[i] << " " ; } void IndiaBix::BixFunction(void) { static int i = 0, j = 4; int tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp ; i++; j--; if(j != i) BixFunction(); } int main() { IndiaBix objBix = {{ 5, 6, 3, 9, 0 }}; objBix.BixFunction(); objBix.Display(); return 0; }

[A].0 9 3 6 5
[B].9 3 6 5 0
[C].5 6 3 9 0
[D].5 9 3 6 0 

Answer: Option A