You are here : Home >> Infosys Archive >> Infosys Pseudo Codes Questions
Q. How many times will loop execute ? [2021]
int x=222
while(x<225)
{
print x
x=x++
}
A. 0
B. 1
C. 2
D. None of the above
Ans. D
Explanation : Loop will run infinitely.
You are here : Home >> Infosys Archive >> Infosys Pseudo Codes Questions
Q. Which of these statement regarding the pseudocode given below is correct ? [2021]
for i=0 to n-1
j=1
while j>0 and A[j]< A[j-1]
swap(A[j],A[j-1])
j=j+1
A. Bubble sort is being implemented to sort an array
B. Merge sort is being implemented to sort an array
C. Insertion sort is being implemented to sort an array
D. The code doesn’t sort an array
Ans. A
Explanation : Above code is for Bubble sort.
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