Discussion :: Functions - C++
-
What will be the output of the following program?
#include struct GateArray { int arr[5]; public: void GateFunction(); void Display(); }; void GateArray::GateFunction() { static int i = 0, j = 4; i++; j--; if(j > 0) GateFunction(); int tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp; i--; j++; } void GateArray::Display() { for(int i = 0; i 5; i++) cout" "; } int main() { GateArray objArr = {{5, 6, 3, 9, 0}}; objArr.GateFunction(); objArr.Display(); return 0;
Answer : Option D
Explanation :
No answer description available for this question.
Be The First To Comment

Whatsapp
Facebook