Functions

Q1: What will be the output of the following program?
#include<iostream.h> 
struct AptitudeCrack
{
    int arr[5]; 
    public:
    void AptitudeFunction(void);
    void Display(void);
};
void AptitudeCrack::Display(void)
{
    for(int i = 0; i < 5; i++) 
        cout<< arr[i] << ' ' ;
}
void AptitudeCrack::AptitudeFunction(void)
{
    static int i = 0, j = 4; 
    int tmp = arr[i]; 
    arr[i]  = arr[j]; 
    arr[j]  = tmp   ; 
    i++;
    j--;
    if(j != i) AptitudeFunction();
}
int main()
{
    AptitudeCrack objAptitude = {{ 5, 6, 3, 9, 0 }};
    objAptitude.AptitudeFunction();
    objAptitude.Display();
    return 0; 
}

A 5 9 3 6 0

B 5 6 3 9 0

C 0 9 3 6 5

D 9 3 6 5 0

ANS:A - 0 9 3 6 5

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.