Programming Fundamentals
Computer Programming Knowledge and Computer Applications Test for MCA Entrance and General Knowledge Tests and Preparation Materials
Questions
Which among these are used to store the data permanently?
- Structures
- Arrays
- Variables
- Files
Arrays and structures can be represented by
- text files
- unformatted files
- formatted data files
- none of these
Which of the following file types is used to close a file?
- r
- w
- rw
- r+
If the queue is represented by an array, then which of the following is true?
- There are possibilities of overflow.
- Efficient access to the items in the queue is not possible.
- Items in the middle of the queue can be removed or deleted.
- Items can be stored in the non-contiguous memory locations.
A file pointer is_______________________
- a stream pointer
- a buffer pointer
- a pointer to a file data type
- all of the above
_________________ function is used to check the end of file condition.
- NULL
- EOF
- FEOF
- !NULL
I/O stream can be _______
- a text stream
- a binary stream
- both 1 and 2
- an I/O operation
What is the result of the following postfix e 6 3 3 + - 3 8 2 / + + 2 $ 3 + expression?
- 52
- 172
- 8.5
- 16807
If (front == rear) then
- the queue contains only one item
- the queue is empty
- the queue contains two elements
- underflow condition will occur
____________________ file is the output of a compiler.
- .c
- .h
- .obj
- .exe
Which of the following is a static data stucture?
- Stacks
- Arrays
- Queues
- Linked lists
Among the following, which is not a type of debugging?
- Inspection of code
- Random checking
- Debugging, using logging
- Debugging, using IDE
Data types whose properties are independent of any implementation are called
- ADT
- ntegers
- float
- none of these
In a queue, the end from which an item is deleted is called
- rear
- front
- top
- begin
___________file is the output of a linker.
- .c
- .h
- .obj
- .exe
The output of the following code snippet is ___________ ( ) Unsigned
int icount=1;
While(icount<10);
{
Printf(%u,icount);
}
- 1,2,_ _ _ 10
- an infinite loop
- 1,2,3 _ _ _ 9
- error in code
The expression has to be evaluated right -to-left or left -to-right depends on the operators____
- precedence
- associativity
- directionality
- none of these
_____ is used in compilers in passing an expression by recursion.
- Stack
- Queue
- Circular queue
- None of these
The output of the following code snippet is ________ ( )
Int iNum=2;
Switch(iNum)
{
case 1.5: printf(ONE AND HALF);
Break;
case 2: printf(TWO);
case 4: printf(FOUR);
}
- ONE AND HALF
- TWO
- FOUR
- error in code
The output of the following code snippet is ___________ ( )
main( )
{
int x=3,y,z;
y=x=10; z=x<10;
printf(n x=%d y=%d z=%d,x,y,z);
}
- 10 10 10
- 10 10 0
- 3 10 10
- error in code
The output of the following code snippet is __________ ( )
main( )
{
int b[]=
{
10,20,30,40,50
};
int i;
for(i=0; i<=4 ;i++)
Printf(n %d,*(b+i));
}
- 1 2 3 4 5
- 2000 2002 2004 2006 2008
- 10 20 30 40 50
- error in code
__________________ is a pointer to a structure operator.
- &
- *
- ->
- <-
The output of the following code snippet, when num is 11 is _______
If (num%2=0)
Printf(number is even);
Else
Printf(number is odd);
- number is even
- number is odd
- displays nothing
- error in code
______________ is the declararion of a pointer to an array.
- int *p[10]
- int (*p)[10]
- int *p
- none of these
The break statement in a nested loop results in ___________
- the control outside the loop stucture
- the control outside the innermost loop
- the control outside the program
- none of these