Question 1 |
Consider the following program
{
int x=1;
printf("%d",(*char(char*)&x));
}
Assuming required header files are included and if the machine in which this program is executed is little endian, then the output will be0 | |
99999999 | |
1 | |
unpredictable |
Question 1 Explanation:
Question 2 |
Consider the following declaration :
structaddr {
char city[10];
char street[30];
int pin;
};
struct {
char name[30];
int gender;
struct addr locate;
} person, *kd = &person;
Then ^{\star}(k d->\text { name }+2) can be used instead of:person.name+2 | |
k d->(\text { name }+2) | |
*((* k d) . \text { name }+2) | |
either (A) or(B), not (C) |
Question 2 Explanation:
Question 3 |
If a variable can take only integral values from 0 to n, where n is an integer, then the variable can be represented as a bit-field whose width is (the log in the answer are to the base 2, and \lceil\log n\rceil means the floor of \log_{}{n} )
\left \lceil \log (n) \right \rceil + 1 \text{ bits} | |
\left \lceil \log (n-1) \right \rceil + 1 \text{ bits} | |
\left \lceil \log (n+1) \right \rceil + 1\text{ bits} | |
None of the above |
Question 3 Explanation:
Question 4 |
The following C program:
{
fork(); fork(); printf("yes");
}
If we execute this core segment, how many times the string yes will be printed?Only once | |
2 times | |
4 times | |
8 times |
Question 4 Explanation:
Question 5 |
Considering the following table in a relational database :
\begin{array}{|c|c|c|c|} \hline \text { Last Name } & \text { Rank } & \text { Room } & \text { Shift } \\ \hline \text { Smith } & \text { Manager } & 234 & \text { Morning } \\ \hline \text { Jones } & \text { Custodian } & 33 & \text { Afternoon } \\ \hline \text { Smith } & \text { Custodian } & 33 & \text { Evening } \\ \hline \text { Doe } & \text { Clerical } & 222 & \text { Morning } \\ \hline \end{array}
According to the data shown in the table, which of the following could be a candidate key of the table?
\begin{array}{|c|c|c|c|} \hline \text { Last Name } & \text { Rank } & \text { Room } & \text { Shift } \\ \hline \text { Smith } & \text { Manager } & 234 & \text { Morning } \\ \hline \text { Jones } & \text { Custodian } & 33 & \text { Afternoon } \\ \hline \text { Smith } & \text { Custodian } & 33 & \text { Evening } \\ \hline \text { Doe } & \text { Clerical } & 222 & \text { Morning } \\ \hline \end{array}
According to the data shown in the table, which of the following could be a candidate key of the table?
{Last Name} | |
{Room} | |
{Shift} | |
{Room, Shift} |
Question 5 Explanation:
Question 6 |
A data driven machine is one that executes an instruction if the needed data is available. The physical ordering of the code listing does not dictate the course of execution. Consider the following pseudo-code:
A. Multiply E by 0.5 to get F
B. Add A and B to get E
C. Add B with 0.5 to get D
D. Add E and F to get G
E. Add A with 10.5 to get C
Assume A,B,C are already assigned values and the desired output is G. Which of the following sequence of execution is valid?
A. Multiply E by 0.5 to get F
B. Add A and B to get E
C. Add B with 0.5 to get D
D. Add E and F to get G
E. Add A with 10.5 to get C
Assume A,B,C are already assigned values and the desired output is G. Which of the following sequence of execution is valid?
B, C, D, A, E | |
C, B, E, A, D | |
A, B, C, D, E | |
E, D, C, B, A |
Question 6 Explanation:
Question 7 |
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
Computes the LCM of two numbers | |
Divides the larger number by the smaller number | |
Computes the GCD of two numbers | |
Finds the smaller of two numbers |
Question 7 Explanation:
Question 8 |
A language with string manipulation facilities uses the following operations.
head(s)- returns the first character of the string s
tails(s)- returns all but the first character of the string s
concat(s1,s2)- concatenates string s1 with s2.
The output of concat(head(s), head(tail(tail(s)))), where s is acbc is:
head(s)- returns the first character of the string s
tails(s)- returns all but the first character of the string s
concat(s1,s2)- concatenates string s1 with s2.
The output of concat(head(s), head(tail(tail(s)))), where s is acbc is:
ab | |
ba | |
ac | |
aa |
Question 8 Explanation:
Question 9 |

In the diagram above, the inverter (NOT gate) and the AND-gates labeled 1 and 2 have delays of 9, 10 and 12 nanoseconds (ns), respectively. Wire delays are negligible. For certain values a and c, together with certain transition of b, a glitch (spurious output) is generated for a short time, after which the output assumes its correct value. The duration of glitch is:
7 ns | |
9 ns | |
11 ns | |
13 ns |
Question 9 Explanation:
Question 10 |
Which of the following comparisons between static and dynamic type checking incorrect?
Dynamic type checking slows down the execution | |
Dynamic type checking offers more flexibility to the programmers | |
In contrast to Static type checking, dynamic type checking may cause failure in runtime due to type errors | |
Unlike static type checking dynamic type checking is done during compilation |
Question 10 Explanation:
There are 10 questions to complete.