Aon Hewitt Interview Questions

Dowload latest interview questions and answer pfd format , here you can find the latest Aon Hewitt interview questions with solved answers.

Aon Hewitt Interview Questions

 

1 . What will be output when you will execute following c
code?
#include<stdio.h>
#define var 3
int main(){
char *cricket[var+~0]={“clarke”,”kallis”};
char *ptr=cricket[1+~0];
printf(“%c”,*++ptr);
return 0;
}
Choose all that apply:
(A) a
(B) r
(C) l
(D) Compilation error
(E) None of the above

 

[expand title=”Show Answer” swaptitle=”Hide”]

Answer: (C)

Explanation:
In the expression of size of an array can have micro
constant.
var +~0 = 3 + ~0 = 3 + (-1) = 2
Let‟s assume string “clarke” and “kallis” has stored at
memory address 100 and 500 respectively as shown in the
following figure:
For string “clarke”:

[/expand]


 

2. What will be output when you will execute following c code?

#include<stdio.h>
int main(){
int check=2;
switch(check)
{case 1: printf(“D.W.Steyn”);
case 2: printf(” M.G.Johnson”);
case 3: printf(” Mohammad Asif”);
default: printf(” M.Muralidaran”);
}
return 0;
}

Choose all that apply:
(A) M.G.Johnson
(B) M.Muralidaran
(C) M.G.Johnson Mohammad Asif M.Muralidaran
(D) Compilation error
(E) None of the above

[expand title=”Show Answer” swaptitle=”Hide”]

Answer: (C)

Explanation:

If we will not use break keyword in each case the program control will come in each case after the case witch satisfy the switch condition.

[/expand]


 

3. What will be output of the following c program?

#include<stdio.h>
int main()
{ int class=150;
int public=25;
int private=30;
class = class >> private – public;
printf(“%d”,class);
return 0;
}

(A) 1
(B) 2
(C) 4
(D) Compilation error
(E) None of these

[expand title=”Show Answer” swaptitle=”Hide”]

Answer: (C)

Explanation:

Variable name can be keyword of c++.

[/expand]


 

4. What will be output of following program?

#include<stdio.h>
int main(){
int i = 3;
int *j;
int **k;
j=&i;
k=&j;
printf(%u %u %d ”,k,*k,**k);
return 0;
}

(A) Address, Address, 3
(B) Address, 3, 3
(C) 3, 3, 3
(D) Compilation error
(E) None of above

[expand title=”Show Answer” swaptitle=”Hide”]

Answer: (A)

Explanation:

Memory representation
Here 6024, 8085, 9091 is any arbitrary address, it may be different.
Value of k is content of k in memory which is 8085
Value of *k means content of memory location which

address k keeps.
k keeps address 8085 .
Content of at memory location 8085 is 6024
In the same way **k will equal to 3.
Short cut way to calculate:
Rule: * and & always cancel to each other

i.e. *&a = a
So *k = *(&j) since k = &j
*&j = j = 6024
And
**k = **(&j) = *(*&j) = *j = *(&i) = *&i = i = 3

[/expand]


 

5 . What will be output if you will execute following c code?

#include<stdio.h>
int main(){
char arr[11]=”The African Queen”;
printf(“%s”,arr);
return 0;
}

(A) The African Queen
(B) The
(C) Queen
(D) null
(E) Compilation error

Answer: (D)

hope you find Aon Hewitt interview questions useful ,you can also try Aon Hewitt Placement papers 2014 solved to practice more , Aptitude questions also can be asked in interview process. Best of Luck !

Check latest job openings here.

Leave a Comment

Your email address will not be published. Required fields are marked *