Microsoft Interview Question Software Engineer in Tests
0of 0 votesFind output of the following code
int
mingle(int a, int b)
{
int c = b/2;
if (b<=1) { return a;}
cout<<c <<endl;
return a*(b-2*c) + mingle(a,c);
}
int
main()
{
int i;
for (i = 1; i<=5 ; i++) {
cout<<mingle(i+1,i-1)<<endl;
}
return 0;
}

1
- Anonymous on September 18, 2010 Edit | Flag Reply2
3
8
30
10
5