C-DAC C-CAT study materials
C-DAC C-CAT study resources

C-DAC C-CAT practice questions

One question at a time. Build your C-DAC C-CAT understanding.

First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.

Continue in the practice tool above to load more questions, 50 at a time.

Question 1C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A C program stores the integer 7 in an 8-bit signed char variable. What is the hexadecimal representation of this value in memory?

  1. 0x70
  2. 0x07 Correct answer.
  3. 0xF7
  4. 0x87

Explanation

A positive value of 7 fits within 8 bits, so its binary form is 0000 0111. Grouping the bits into two nibbles gives 0000 (0) and 0111 (7), hence 0x07. Sign extension does not alter the stored byte for a positive number.

Question 2C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

In a C-CAT computer fundamentals context, which component of the CPU is responsible for performing arithmetic such as addition and logical comparisons?

  1. Program Counter
  2. Control Unit
  3. Memory Address Register
  4. Arithmetic Logic Unit Correct answer.

Explanation

The Arithmetic Logic Unit (ALU) executes arithmetic and logical operations on data held in registers. The control unit only directs and coordinates, while the program counter and memory address register hold addresses, not perform computation.

Question 3C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A shopkeeper marks an item 40% above cost and then allows a discount of 25% on the marked price. What is the profit percentage on cost?

  1. 20%
  2. 5% Correct answer.
  3. 10%
  4. 15%

Explanation

Let cost be 100. The marked price becomes 140, and a 25% discount reduces it by 35, giving a selling price of 105. Profit is 5 on a cost of 100, so the profit percentage is 5%.

Question 4C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

Which of the following is the correct binary equivalent of the decimal number 45?

  1. 100101
  2. 101101 Correct answer.
  3. 110101
  4. 101011

Explanation

Repeated division by 2 gives remainders 1,0,1,1,0,1 read bottom-up, producing 101101. Checking place values: 32+8+4+1 = 45, which confirms the result.

Question 5C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

In a certain code, C-DAC is written as D-EBD. Which rule is being applied?

  1. Each letter is shifted one place backward in the alphabet.
  2. Each letter is shifted one place forward in the alphabet. Correct answer.
  3. Letters at odd positions are shifted forward and even positions backward.
  4. Only the vowels are replaced by the next consonant.

Explanation

Comparing C to D, D to E, A to B and C to D, every letter moves exactly one step forward in the alphabet. The hyphen is retained unchanged. No alternating or vowel-specific rule is needed to explain the pattern.

Question 6C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

Which keyword in C is used to terminate the current iteration of a loop and proceed directly to the next iteration?

  1. goto
  2. continue Correct answer.
  3. break
  4. return

Explanation

The continue statement skips the remaining statements in the current loop body and jumps to the next iteration's condition or increment step. The break statement exits the loop entirely, which is a different behaviour.

Question 7C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A sum of money doubles itself in 8 years under simple interest. In how many years will it become four times itself at the same rate?

  1. 16 years
  2. 32 years
  3. 24 years Correct answer.
  4. 20 years

Explanation

Doubling means the interest earned in 8 years equals the principal. To become four times, the interest must equal three times the principal, which requires 3 × 8 = 24 years. Simple interest grows linearly, so the ratio of times equals the ratio of interest amounts.

Question 8C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

What is the output of the following C statement? printf("%d", 7 / 2 * 2);

  1. 3
  2. 6 Correct answer.
  3. 7
  4. 3.5

Explanation

Integer division 7/2 truncates to 3, and multiplying by 2 gives 6. The expression is evaluated left to right because division and multiplication have equal precedence. No floating-point conversion occurs since both operands are integers.

Question 9C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

Six friends A, B, C, D, E and F sit in a row facing north. A is third to the left of D, and D is at the extreme right end. Who sits at the extreme left end?

  1. F
  2. B
  3. A
  4. C Correct answer.

Explanation

With D at the extreme right (position 6), A sits third to its left at position 3. Positions 1 and 2 remain, but the given clues fix only A and D, so the extreme left is one of the unplaced friends. Careful reading shows C is forced there once A is fixed at position 3 and the remaining order is constrained.

Question 10C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

Which of the following correctly declares an array of 10 integers in C?

  1. array int arr[10];
  2. int arr{10};
  3. int arr(10);
  4. int arr[10]; Correct answer.

Explanation

The standard C syntax places the size in square brackets after the identifier and type: int arr[10];. Parentheses and braces are not valid for array size declaration in classic C.

Question 11C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A boat travels 30 km downstream in 2 hours and returns the same distance upstream in 3 hours. What is the speed of the stream?

  1. 7.5 km/h
  2. 5 km/h
  3. 10 km/h
  4. 2.5 km/h Correct answer.

Explanation

Downstream speed is 30/2 = 15 km/h and upstream speed is 30/3 = 10 km/h. The stream speed is half the difference, (15 − 10)/2 = 2.5 km/h. The boat's still-water speed would be 12.5 km/h.

Question 12C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

In a relational database, which key uniquely identifies each row and cannot contain null values?

  1. Candidate key
  2. Alternate key
  3. Foreign key
  4. Primary key Correct answer.

Explanation

A primary key enforces both uniqueness and non-null constraint on the chosen column or set of columns. A foreign key references another table, and candidate or alternate keys are possible unique identifiers but are not necessarily enforced as non-null.

Question 13C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

The average age of 20 students is 15 years. When the teacher's age is included, the average rises by 1 year. What is the teacher's age?

  1. 37 years
  2. 35 years
  3. 40 years
  4. 36 years Correct answer.

Explanation

Total age of students is 20 × 15 = 300. With the teacher, there are 21 people averaging 16, giving a total of 336. The teacher's age is 336 − 300 = 36 years.

Question 14C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

What does the following C code print? int i = 0; while(i < 3) { printf("%d", i); i++; }

  1. 012 Correct answer.
  2. 123
  3. 111
  4. 0123

Explanation

The loop prints i before incrementing, starting at 0 and running while i is less than 3. It prints 0, 1 and 2, then i becomes 3 and the condition fails. Hence the output is 012.

Question 15C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

Which logic gate produces a HIGH output only when all its inputs are HIGH?

  1. OR gate
  2. XOR gate
  3. AND gate Correct answer.
  4. NAND gate

Explanation

An AND gate outputs 1 only when every input is 1; any 0 forces the output to 0. OR outputs 1 if any input is 1, NAND is the inverse of AND, and XOR outputs 1 only for an odd number of 1 inputs.

Question 16C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

Pointing to a photograph, a man says, "She is the daughter of the only son of my mother." How is the woman related to the man?

  1. Sister
  2. Mother
  3. Niece
  4. Daughter Correct answer.

Explanation

The only son of the man's mother is the man himself (or his brother, but 'only son' points to the speaker). The daughter of that person is therefore the man's daughter. Tracing relationships step by step avoids ambiguity.

Question 17C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

Which of the following is a characteristic of the binary search algorithm?

  1. It requires the data to be sorted before searching. Correct answer.
  2. It has linear time complexity in the average case.
  3. It always compares every element once.
  4. It works on unsorted data without preprocessing.

Explanation

Binary search repeatedly halves the search interval, which is only valid when the data is sorted so that comparisons can discard half the remaining elements. Its average and worst-case complexity is O(log n), not linear.

Question 18C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A bag contains 5 red and 7 blue balls. Two balls are drawn at random without replacement. What is the probability that both are red?

  1. 5/12
  2. 25/144
  3. 5/33 Correct answer.
  4. 10/33

Explanation

The probability of the first red is 5/12, and after removing one red the probability of the second red is 4/11. Multiplying gives 20/132 = 5/33. Drawing without replacement changes the denominator for the second draw.

Question 19C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

In C, what is the value of the expression 5 & 3 using bitwise AND?

  1. 7
  2. 2
  3. 1 Correct answer.
  4. 8

Explanation

In binary, 5 is 101 and 3 is 011. Bitwise AND compares each bit, giving 001, which equals 1. Bitwise OR would give 111 = 7, which is a different operator.

Question 20C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A program uses a function that calls itself with a smaller input until a base condition is met. Which term describes this technique?

  1. Overloading
  2. Iteration
  3. Polymorphism
  4. Recursion Correct answer.

Explanation

A function that invokes itself on a reduced problem is recursive, and it must include a base case to stop the calls. Iteration uses loops instead of self-calls, while overloading and polymorphism are unrelated concepts.

Question 21C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

What is the output of the following C code? int a = 5, b = 2; printf("%d", a++ + ++b);

  1. 7
  2. 10
  3. 8 Correct answer.
  4. 9

Explanation

The expression a++ yields 5 and then increments a to 6, while ++b first increments b to 3 and yields 3. The sum is 5 + 3 = 8. The order of evaluation between operands matters here, but the postfix and prefix effects are as stated.

Question 22C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A man walks 5 km north, turns right and walks 3 km, then turns right again and walks 5 km. How far is he from his starting point and in which direction?

  1. 3 km west
  2. 5 km north
  3. 8 km east
  4. 3 km east Correct answer.

Explanation

Moving 5 km north then 3 km east then 5 km south cancels the north-south displacement. The net displacement is 3 km to the east of the start. Drawing the path confirms the vertical legs cancel.

Question 23C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

Consider the recurrence T(n) = 2T(n/2) + n for n > 1, with T(1) = 1. What is the order of growth of T(n)?

  1. O(n log n) Correct answer.
  2. O(log n)
  3. O(n^2)
  4. O(n)

Explanation

This recurrence matches the merge sort pattern: the work per level is n and there are log n levels, giving O(n log n). The Master Theorem's second case applies because the combining cost n equals n^(log base 2 of 2).

Question 24C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

In a class of 40 students, 25 play cricket, 20 play football and 10 play both. How many play neither game?

  1. 5 Correct answer.
  2. 0
  3. 10
  4. 15

Explanation

By inclusion-exclusion, the number playing at least one game is 25 + 20 − 10 = 35. Subtracting from 40 leaves 5 students who play neither. The subtraction of the overlap avoids double counting.

Question 25C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A C program declares int *p; and then uses p without assigning any address before dereferencing it. What is the nature of the error?

  1. No error, since p defaults to address 0
  2. Runtime undefined behaviour due to a dangling pointer
  3. Runtime undefined behaviour due to an uninitialized pointer Correct answer.
  4. Compile-time syntax error

Explanation

An uninitialized pointer holds an indeterminate value, so dereferencing it invokes undefined behaviour, often a crash. The compiler usually accepts the syntax, so it is not a syntax error, and the pointer is not dangling because it never pointed to valid memory.

Question 26C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A C program contains the statement `int x = 10;` inside a function. Which term best describes the storage duration of the variable x?

  1. Dynamic
  2. Static
  3. Register
  4. Automatic Correct answer.

Explanation

A variable declared inside a function without the static or extern specifier has automatic storage duration: it is created when the block is entered and destroyed when the block is exited. The register keyword only suggests faster access and does not change the fundamental storage duration class in this context.

Question 27C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

In C, what does the expression `sizeof('A')` evaluate to on a typical compiler where char is 1 byte and int is 4 bytes?

  1. 1
  2. 2
  3. 4 Correct answer.
  4. 8

Explanation

In C, a character constant such as 'A' has type int, not char, so sizeof('A') yields the size of an int. On the stated platform that is 4 bytes. This differs from C++ where character constants have type char.

Question 28C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A recursive function is defined as `int f(int n) { return n <= 1 ? 1 : n * f(n - 1); }`. What value does `f(5)` return?

  1. 24
  2. 120 Correct answer.
  3. 5
  4. 15

Explanation

The function computes the factorial of n: f(5) = 5 × 4 × 3 × 2 × 1 = 120. The base case n <= 1 returns 1, so the recursion terminates correctly.

Question 29C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

Which data structure is most suitable for implementing a function-call mechanism where the most recent call must return first?

  1. Stack Correct answer.
  2. Queue
  3. Binary tree
  4. Linked list

Explanation

Function calls follow last-in-first-out order: the most recently called function must finish before its caller resumes. A stack supports this LIFO discipline directly. Queues are first-in-first-out and do not match the call-return pattern.

Question 30C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A relational table has a composite primary key made of columns (student_id, course_id). Which statement about this key is correct?

  1. Only student_id needs to be unique; course_id may repeat.
  2. The key must include a column of type integer.
  3. Each column individually must be unique.
  4. The combination of values must be unique, but individual columns may repeat. Correct answer.

Explanation

A composite primary key enforces uniqueness on the combination of its columns, not on each column separately. A student can appear in many rows with different courses, and a course can appear in many rows with different students, as long as no pair repeats. No column data type is mandated by the relational model.

Question 31C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

In the context of the C-DAC admission test, which number system conversion is performed when the decimal value 45 is expressed in binary?

  1. 101011
  2. 110101
  3. 111001
  4. 101101 Correct answer.

Explanation

Repeated division by 2 gives remainders 1, 0, 1, 1, 0, 1 from least to most significant, yielding 101101. Checking place values: 32 + 8 + 4 + 1 = 45.

Question 32C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A logic circuit has three inputs A, B and C. Its output is defined as 1 only when an odd number of inputs are 1. Which gate implements this function directly?

  1. XOR gate Correct answer.
  2. XNOR gate
  3. NAND gate
  4. NOR gate

Explanation

The XOR function outputs 1 when the number of 1 inputs is odd. For three inputs, cascaded XOR gates, A ⊕ B ⊕ C, produce 1 for input combinations with one or three 1s. XNOR and the universal NAND/NOR gates do not match this parity behaviour.

Question 33C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

Which scheduling algorithm may cause starvation of long processes because it always selects the process with the smallest estimated next CPU burst?

  1. First-Come First-Served
  2. Shortest Job First Correct answer.
  3. First-In First-Out
  4. Round Robin

Explanation

Shortest Job First repeatedly picks the process with the smallest next CPU burst, so a continuous supply of short jobs can postpone a long job indefinitely. FCFS and FIFO are order-based, and Round Robin uses a time quantum, all of which provide eventual service.

Question 34C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A programmer writes `int *p = (int *)malloc(10 * sizeof(int));` in C. Which statement about this allocation is correct?

  1. The memory is initialised to zero automatically.
  2. The cast to int * is mandatory in all C standards.
  3. The memory must be released with free(p) when no longer needed. Correct answer.
  4. malloc always returns a pointer to the stack.

Explanation

Memory obtained from malloc has dynamic storage duration and must be released with free to avoid a memory leak. malloc does not initialise the bytes, a cast is unnecessary in C (though harmless), and the returned block comes from the heap, not the stack.

Question 35C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

In a class of 60 students, 35 like tea, 30 like coffee, and 15 like both. How many students like neither tea nor coffee?

  1. 15
  2. 10 Correct answer.
  3. 20
  4. 5

Explanation

By inclusion-exclusion, the number who like at least one beverage is 35 + 30 − 15 = 50. Subtracting from the total gives 60 − 50 = 10 students who like neither.

Question 36C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A sum invested at compound interest becomes ₹1,21,000 in 2 years at 10% per annum. What was the principal amount?

  1. ₹1,00,000 Correct answer.
  2. ₹1,05,000
  3. ₹1,10,000
  4. ₹1,15,000

Explanation

For compound interest, A = P(1 + r)^n. Here 1,21,000 = P(1.1)^2 = 1.21P, so P = 1,21,000 / 1.21 = 1,00,000. The principal is therefore ₹1,00,000.

Question 37C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A train 150 m long passes a pole in 15 seconds. What is the speed of the train in km/h?

  1. 36 Correct answer.
  2. 54
  3. 45
  4. 30

Explanation

Passing a pole means covering the train's own length, so speed = 150 m / 15 s = 10 m/s. Converting to km/h by multiplying by 18/5 gives 10 × 18/5 = 36 km/h.

Question 38C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A shopkeeper marks an article at ₹800 and allows a discount of 15%. He still makes a profit of 20% on the cost price. What is the cost price?

  1. ₹640
  2. ₹600
  3. ₹680
  4. ₹566.67 Correct answer.

Explanation

The selling price after a 15% discount is 800 × 0.85 = ₹680. If this represents a 20% profit, then cost price = 680 / 1.2 = ₹566.67 (approximately).

Question 39C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

In a certain code, if C-DAC is written as D-EBD, how is EXAM written in the same code?

  1. FXBN
  2. FYBM
  3. EYBN
  4. FYBN Correct answer.

Explanation

Each letter is shifted one position forward in the alphabet: C→D, D→E, A→B, C→D. Applying the same rule to EXAM gives F, Y, B, N, i.e. FYBN.

Question 40C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

Five people P, Q, R, S and T are standing in a queue. Q is ahead of R but behind S. T is ahead of P but behind R. Who is at the front of the queue?

  1. T
  2. R
  3. S Correct answer.
  4. Q

Explanation

The statements give S ahead of Q, Q ahead of R, R ahead of T, and T ahead of P. Chaining these yields S, Q, R, T, P from front to back, so S is at the front.

Question 41C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

Find the next term in the series: 2, 6, 12, 20, 30, ?

  1. 44
  2. 36
  3. 40
  4. 42 Correct answer.

Explanation

The differences are 4, 6, 8, 10, which increase by 2 each time. The next difference should be 12, so the next term is 30 + 12 = 42. Equivalently, the terms are n(n+1) for n = 1, 2, 3, …

Question 42C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A statement followed by two conclusions is given. Statement: All programmers are logical. Some logical people are artists. Conclusions: I. Some programmers are artists. II. All artists are logical. Which conclusion(s) follow(s)?

  1. Only II follows
  2. Both I and II follow
  3. Neither I nor II follows Correct answer.
  4. Only I follows

Explanation

The statement that some logical people are artists does not guarantee that any of those artists are programmers, so conclusion I does not follow. It also does not state that all artists are logical, so conclusion II does not follow. Hence neither conclusion is entailed.

Question 43C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A clock shows 3:30. What is the angle between the hour hand and the minute hand?

  1. 70°
  2. 85°
  3. 75° Correct answer.
  4. 90°

Explanation

At 3:30 the minute hand points at 6 (180° from 12). The hour hand has moved half an hour past 3, so its position is 3 × 30° + 0.5 × 30° = 90° + 15° = 105°. The difference is 180° − 105° = 75°.

Question 44C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A and B together can complete a task in 12 days. A alone can complete it in 20 days. In how many days can B alone complete the task?

  1. 24
  2. 32
  3. 28
  4. 30 Correct answer.

Explanation

Combined rate = 1/12 of the task per day, and A's rate = 1/20. B's rate = 1/12 − 1/20 = (5 − 3)/60 = 2/60 = 1/30, so B alone takes 30 days.

Question 45C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

Which normal form in relational database design eliminates partial dependency of non-key attributes on a composite primary key?

  1. Third Normal Form
  2. First Normal Form
  3. Second Normal Form Correct answer.
  4. Boyce-Codd Normal Form

Explanation

Second Normal Form requires that the relation be in 1NF and that every non-prime attribute be fully functionally dependent on the whole primary key, which removes partial dependencies. Third Normal Form and BCNF go further by addressing transitive dependencies and other anomalies.

Question 46C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A relational schema has a relation R(A, B, C) with functional dependencies A → B and B → C. Which statement is true?

  1. R is in BCNF.
  2. The only candidate key is A. Correct answer.
  3. R is not in 2NF.
  4. R is in 3NF but not in BCNF.

Explanation

A determines B and B determines C, so A determines all attributes; A is a candidate key. No other attribute determines all attributes, so A is the only candidate key. The relation has a transitive dependency A → B → C, so it is not in 3NF or BCNF, and partial dependency does not arise because the key is a single attribute.

Question 47C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

In C, what is the output of the following code snippet? `int a[3] = {1, 2, 3}; printf("%d", *(a + 2));`

  1. Garbage value
  2. 2
  3. 1
  4. 3 Correct answer.

Explanation

The expression a + 2 points to the third element of the array, and dereferencing it with * yields the value 3. Array indexing a[2] is equivalent to *(a + 2).

Question 48C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A binary search tree is built by inserting the keys 50, 30, 70, 20, 40, 60, 80 in that order. What is the height of the resulting tree if the height of a single-node tree is 1?

  1. 4
  2. 2
  3. 3 Correct answer.
  4. 5

Explanation

The root is 50; its left child is 30 and right child 70. The next level contains 20 and 40 under 30, and 60 and 80 under 70. This gives three levels, so the height is 3.

Question 49C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

Consider the C declaration `int (*fp)(int, int);`. What does fp represent?

  1. A pointer to an array of ints
  2. An array of function pointers
  3. A function returning a pointer to int
  4. A pointer to a function taking two ints and returning int Correct answer.

Explanation

The parentheses bind the asterisk to fp, so fp is a pointer. The trailing (int, int) indicates a function taking two int arguments, and the leading int is the return type. Hence fp is a pointer to a function returning int.

Question 50C-DAC Post Graduate Diploma programme admission (English, Reasoning, Quantitative Aptitude, Computer Fundamentals/Programming)

A process uses 4 pages of 1 KB each and is allocated 3 frames. Using the FIFO page replacement algorithm, the reference string is 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5. How many page faults occur?

  1. 9 Correct answer.
  2. 7
  3. 8
  4. 10

Explanation

Simulating FIFO with 3 frames: references 1, 2, 3 fault (3 faults). Reference 4 evicts 1 (4th fault). Reference 1 evicts 2 (5th). Reference 2 evicts 3 (6th). Reference 5 evicts 4 (7th). References 1 and 2 are hits. Reference 3 evicts 1 (8th). Reference 4 evicts 2 (9th). Reference 5 is a hit. Total faults = 9. Careful simulation confirms this count.