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:
There are 5 questions to complete.