You are here : Home >> Infosys Archive >> Infosys Pseudo Codes Questions
Q. What will be the output of following code :
int main()
{
int a = 4, b = 2;
printf(“a^b = %d”, a^b);
return 0;
}
A. 4
B. 1
C. 0
D. 6
Ans. D
(d)
Explanation : Above code is just for performing the xor operation between two variables.
You are here : Home >> Infosys Archive >> Infosys Pseudo Codes Questions
Q. What will be output of given pseudo code :
int j=41, k= 37
j=j+1
k=k-1
j=j/k
k=k/j
print(k,j)
A. 42 36
B. 36 1
C. 1 1
D. 1 36
(d)
Explanation :
j = 41+1 => 42
k = 37-1 => 36
j = 42/36 => 1
k = 36/1 => 36
1, 36.
I LOVE COG, JUST AWESOME CONTENT.
I think its ans is – C1 and C2 and NOT c4
correct ans is b
what they are provided as a answer of this question 18 as d is wrong answer…….
Correct answer is c
here 16. option b is the answer