Assume A and B are non-zero positive integers. The following code segment while(A!=B){ if(A > B) A – = B; else B – = A; } cout << A; // printing the value of A
Asked in GPSC Assistant Director (IT), Class-1 2025
Answer under review: our editors are checking this question. Try the other GPSC Prelims previous year questions questions meanwhile.
More GPSC Prelims previous year questions questions
- Consider the following program fragment if(a > b) if(b > c) s1; else s2; s2 will be executed if
- What does the following algorithm approximate? (Assume m>1,e>0) x = m; y = 1; while (x – y > e) { x = (x + y)/2; y = m/x; } print(x);
- We use malloc and calloc for
- If an array A contains the items 10, 4, 7, 23, 67, 12 and 5, in that order, what will be the resultant array A after third pass of insertion sort?
- A one-dimensional array A has indices 1....75. Each element is a string and takes up three memory words. The array is stored at location 1120 decimal. The starting address of A[49] is
- Consider an unordered list of N distinct integers. What is the minimum number of element comparisons required to find an integer that is NOT the largest in the list?
- Given two statements I. Insertion of an element should be done at the last node of the circular list II. Deletion of an element should be done at the last node of the circular list
- The best data structure to check whether an arithmetic expression has balanced parenthesis is a