Saturday, June 7, 2008

Paper1

C What is the output of the following :
1. main()
{
int *p ;
p=(int *)malloc(-10);
}

a) allocates 0 bytes
b) allocates memory, if available
c) compilation error
d) Runtime error

Ans) b

2. main()
{
for( printf("a") ; printf("b") ; printf("c") ) ;
}

a) abc
b) abc abc abc .....(infinite times)
c) a bc bc bc ....(infinite times)
d) Error

Ans) c

3. main()
{
int i= 10 * fun() ;
printf("%d",i);
}


fun()
{
return 10 ;
}

a) 0
b) 10
c) 100
d) Error

Ans) c

4.
int i= 10 * fun() ;
main()
{
printf("%d",i) ;
}

fun()
{
return 10 ;
}

a) 0
b) 10
c) 100
d) Error

Ans) d


5. Assume size of int to be 2 bytes :

main()
{
int i = 100 ;
printf("%d ", sizeof(i++));
printf("%d ",i) ;
}

a) 2 100
b) 2 101
c) 100 101
d) 101 100

Ans) a


Computer Fundamentals :

1. Which one of the following always resides in the memory ?

a) Linker
b) Loader
c) Compiler
d) All of the Above


Ans) b


2. Which of these is not a layer in OSI model ?

a) Application layer
b) Network Layer
c) Internet Layer
d) Data Link Layer

Ans) c


3. Which one of the following data structures is best suited for searching ?

a) Arrays
b) Singly Linked List
c) Doubly Linked List
d) Hash Table


Ans) d


4. Which of the following data structures is best suited for Deletion ?

a) Arrays
b) Singly Linked List
c) Doubly Linked List
d) Hash Table


Ans) c


5.Which one of these is not a scheduling technique in Operating System?

a) Last-Come-First-Serve Scheduling
b) First-Come-First-Serve Scheduling
c) Preemptive Scheduling
d) Round Robin Scheduling


Ans) a



6. Demand Paging is

a) All the pages of a process is loaded at the start
b) When a single page is demanded then all other pages are also loaded
c) When a page is required then only it is loaded
d) None of the Above


Ans) c


7. Page Fault is

a) A page is referenced that is not in the memory .
b) A page is referenced that is not in the Disk.
c) A page being added to the process.
d) None of the above


Ans) a


8. If the number of internal nodes in a binary tree is n , then what is the number of external nodes ?

a) n -1
b) n
c) n + 1
d) 2n


Ans) c


9. "Banker's Algorithm" is used for :

a) Deadlock Detection
b) Deadlock Avoidance
c) Deadlock Prevention
d) All of the above


Ans) b


10. Which of the following is used fro designing a lexical analyser of a compiler ?

a) Finite Automata
b) Push Down Automata
c) Turing Machine
d) None of the above


Ans) a


11. Which layer in the OSI model is responsible for End to End connectivity ?

a) Data Link Layer
b) Network Layer
c) Transport Layer
d) Session Layer


Ans) c

No comments: