Veritas Test Paper / IIT Kanpur / 01-08-03
------------------------------------------
/*Objective Questions: 30 questions*/
Time duration: 30 minutes.
1. What is the output of the following operation?
0x7e00e9 % 0x7
2. What does a sticky bit do and why?
3.
/* Question is how many processes are created when this program is run */
int main()
{
forkthem(5);
}
void forkthem(int n)
{
if (n>0)
{
fork();
forkthem(n-1);
}
else return;
}
4. preorder and inorder was given, asked which of the options was postorder
/* Please complete */
5. Which of the following representations do not need braces or parenthesis
- prefix, postfix & infix;
6. Give the grammar - E -> E*E | E+E | n,
is it ambiguous? left recursive? none?
7. given the following code in two threads, what will be the range of possible values of n?
/* First Thread */
sum = 0;
for(i = 1;i1 == b) return 1;
else return 0;
}
Part B
------
/*Following is used to find if a 32-bit number is divisible by 3 */
int div3(int n)
{
int i;
int sum = 0;
for(i = 0;i>=1;
}
if(sum == 0) return sum;
if(sum