DXC Technology Computer Programming Questions
A. Stacks
B. Linked Lists
C. Queue
D. Dequeues
1. The graph contains a cycle.
2. The cycle involves only a set of resource types each of which has only a single instance.
A. A deadlock will occur
B. A deadlock will never occur
C. The statement contradicts each other
D. A deadlock may exist
A. Protected
B. Public
C. Private
D. An error will be generated
A. 21
B. 42
C. 16
D. 20
A. It is not possible to run a program without a main function in a program
B. Any program without a main function shall not do anything but can only produce a blank screen
C. Two macros can be used. One to hold the name of a function and its working and the other to call the first macro
D. Any function can be made and marked as starting point using a language dependent syntax
A. 2n+1 nodes
B. log2n nodes
C. 2n—1 nodes
D. 2n nodes
A. Public
B. Private
C. Private and Protected
D. Protected
A.Bubble sort
B.Insertion sort
C.Selection sort
D.Heap sort
What is the efficient way to debug the code?
A. Compile the entire code and check it line by line
B. Use an interpreter on the first 25 lines of code
C. Compile the entire code and run it
D. None of the above can be used to debug the code
(Note: Assume that when two data types are processed through an operator, the answer maintains the same data type as that of the input. Also, all data types have enough range to accommodate any number. If two different data types are operated upon, the result assumes the data type that is more expressive.)
integer a = 984, b=10
//float is a data type to store real numbers.
float c
c = a/b
print c
A.984
B.98.4
C.98
D.Error
A.7
B.35
C.28
D.196
X writes the code (Code A) as follows:
for n= 0 to 1
sumRow1[n]=A[n][0]+A[n][1]
end
Y writes the code (Code B) as follows:
sumRow1[0] =A[0][0] + A[0][1]
sumRow1[1] =A[1][0] + A[1][1]
Which of the following statements is correct about these codes if no loop unrolling is done by the compiler?
A.Code A would execute faster the Code B
B.Code B would execute faster than Code A
C.Code B is logically incorrect
D.Code A is logically incorrect
while (i<= 3)
{
int j // Statement 2
while (j<=1) // Statement 3
{
Print j
print blank space
j=j+1 // Statement 4
}
print end-of-line //takes the cursor to the next line
i=i+1
}
1
1 2
1 2 3
Will this program function properly? If not, which statement should be modified?
A.Statement 1
B.Statement 2
C.Statement 3
D.Statement 4
E.This program will function properly.
A.Radix search
B.Breath first search
C.Recursion
D.None of the above