20CSS01 PPS Question Bank
20CSS01 PPS Question Bank
a) 12345678910
b) 1234678910
c) 123456789
d) 1234578910
36 Which of these best describes an array?
a) A data structure that shows a hierarchical behavior
b) Container of objects of similar types
c) Arrays are immutable once initialized
d) Array is not a data structure
37 If the following code is executed how many times ""Hello"" will be printed?
int main()
{
int k = 0;
for (k = 0; k < 3; k++)
printf(""Hello"");
}
a) Once
b) Twice
c) Thrice
d) Compile Error
38 A merge sort
a) Divides the unsorted array into 3 sublists of equal size
b) Divides the unsorted array into 2 sublists of equal size
c) Divides the unsorted array into 4 sublists of equal size
d) Divides the unsorted array into 5 sublists of equal size
39 The system allocates memory location(s) to hold the ____________ of the variable
a) Address
b) Name
c) Value
d) Data type
40 Which of the following statement is false?
a) Merge sort keeps on dividing the list into equal halves until it can no more be divided.
b) Merge sort combines the smaller sorted lists keeping the new list sorted too.
c) Based on Merge sort definition, if it is only one element in the list, it is sorted.
d) Merge sort works on backtracking technique
41 Fill in the missing line for the following pseudocode
To find Area Of Rectangle()
Begin
Read: width, length;
Print area
End
a) area=length*breadth
b) area
c) area=length*width
d) area=l*b
42 Which of the following shows the correct syntax for an if statement?
a) if expression
b) if { expression
c) if ( expression )
d) expression if
43 The parameters passed to function are called
a) Formal Parameters
b) Actual Parameters
c) Call Back Parameters
d) Return Parameters
44 Predict the Output for the given Program:
int main(){
struct ship {
int size;
char color[10]; }
boat1, boat2;
boat1.size=10;
boat2 = boat1;
printf("boat2=%d",boat2.size);
return 0;}
a) boat2=0
b) boat2=-1
c) boat2=10
d) Compiler error
45 Identify the operators used in pointers
a) *,&
b) <,>
c) #,%
d) &,}
46 Identify the reference operator
a) &
b) <,>
c) #
d) *
47 What is an internal sorting algorithm?
a) Algorithm that uses tape or disk during the sort
b) Algorithm that involves swapping
c) Algorithm that uses main memory during the sort
d) Algorithm that are considered ‘in place’
48 Identify what type of error for the given program.
a) Syntax Error
b) Logical Error
c) Run time Error
d) All of the above
49 Which is the last phase of a six step problem solving Loop?
a) Build and test the ideas
b) Identify the problem
c) Analysing the problem
d) Evaluating the Results
50 ________ statement is used to transfer the flow of control to any part of the program
desired.
a) do while
b) while
c) for
d) jump
51 ______________is the process of finding the location of the specified element in a list.
a) Sorting
b) Array
c) Searching
d) String
52 "Predict The output:
int main()
{
if( 8 > 19 )
{
printf(""Times up..."");
}
printf(""Yes"");
return 0;
}"
a) Yes
b) Times up Yes
c) Times up... Yes
d) Times up...
53 The format identifier %c is also used for _____ data type?
a) Integer
b) Float
c) Character
54 How do you initialize an array in C?
a) int arr[3] = (1,2,3);
b) int arr(3) = [1,2,3];
c) int arr[3] = {1,2,3};
d) int arr{3} = (1,2,3);
55 Associativity of ++, -- and ! Operators in expressions evaluation are from ________.
a) left to right
b) right to left
c) left alone
d) right alone
56 Which among the following is the is a simpler version of a programming code?
a) Algorithm
b) Pseudocode
c) Flowchart
d) Syntax
57 The number of tokens in the following C statement is
printf("i = %d”,i);
a) 7
b) 8
c) 9
d) 10
58 Which of the following will always provide you the guaranteed solution for the given
problems?
a) Algorithmic
b) Heuristic
c) Trial and error
d) All the above
59 Each Variable is having _______________address
a) Same
b) Unique
c) Identical
d) Alike
60 ________ compiles the program for the same architecture that is running on.
a) Native compiler
b) Cross compiler
c) Both 1 & 2
61 Identify the memory address
a) Num
b) 10
c) 0x7fff5694dc58
62 Missing out of Quotes and Brackets in the source code is called as ____________.
a) Syntax Error
b) Logical Error
c) Run time Error
d) All of the above
Answer: Constist
63 Gmail, YouTube, Whatsapp are categorized under which of the following Software
Types?
a) System Software
b) Application Software
c) Programming Software
d) Driver Software
64 Identify the file extension for source code, object code and executable file.
a) .c, .bak, .o
b) .c, .o, .ae
c) .c, .obj, .exe
d) .c, obj, .o
65 int x=40;
main(
{
int x=20;
printf("%d",x);
}
Which is a global variable?
a) 40
b) 20
c) Both
d) None
66 Associativity of C Operators *, /, %, +, - and = is.?
a) Operators *, / and % have Right to Left Associativity. Operators + and - have Left to
Right Associativity. Operator = has Right to Left Associativity.
b) Operators *, / and % have Left to Right Associativity. Operators + and - have Left to
Right Associativity. Operator = has Right to Left Associativity
c) Operators *, / and % have Right to Left Associativity. Operators + and - have Right to
Left Associativity. Operator = has Right to Left Associativity
d) Operators *, / and % have Right to Left Associativity. Operators + and - have Right to
Left Associativity. Operator = has Left to Right Associativity
67 "_________ is the minimum and maximum Indexes of this below array. int main(){int
ary[9];return 0;}
a) 0,8
b) -1,8
c) 1,9
d) -1,-8
68
a) m>n, m<n
b) m<n, m>n
c) m>=n, m<=n
d) m<=n, m>=n
69 Give the size(byte) of the variable pi allocated in memory
a) 2
b) 4
c) 6
d) 8
70 Which of the following is used to make an identifier/variable as a constant?
a) Volatile
b) Const
c) Signed
d) None
71 Linker takes the responsibility to combine __________ and __________ files to produce
an executable file.
a) Object file and Header file
b) Source file and Object file
c) Source file and Header file
d) Object file and .bak file
72 Left shift (<<) and Right shift (>>) operators are equivalent to _____________ by 2.
a) Multiplication and Division
b) Division and Multiplication
c) Multiplication and Remainder
d) Remainder and Multiplication
73 What will strcmp() function do?
a) compares the first n characters of the object b
b) compares the string
c) undefined function
d) copies the string
74 ____________search is a divide and conquer method/Techniques
a) Binary search
b) sequential search
c) random search
d) recursive search
75 Predict the output for the following:
a) \”
b) \
c) “
d) Compile Error
76 The C code ‘for(;;)’ represents
a) finite loop
b) infinite loop
c) iterative loop
77 #include<stdio.h>
void main()
{
int x = 10;
printf("%d", x);
}
Output of the code.
a) 10
b) -10
c) Compile time error
d) x
78 ++a is an example of
a) Pre increment
b) Post increment
c) Pre decrement
d) Post decrement
79 In a program, how the list of errors are identified and indicated by?
a) Running a program
b) Executing a program
c) Compiling a program
d) Output of a program
80 Identify the correct statement of logical errors:
a) S1 only
b) S2 only
c) S3 only
d) S4 only
81 Which is true for a, if a is defined as int a[10][20];?
a) a is true two-dimensional array
b) 200 int-sized locations have been set aside
c) an array contains 10 columns and 20 rows
d) an array contains 10 rows and 20 column
82 Which of the following is the correct order of evaluation for the below expression?
z=a+b*c/4%2–1
a) * / % + - =
b) = * / % + -
c) / * % - + =
d) * % / - + =
83 The post test loop among the following is
a) while
b) do...while
c) for
d) break
84 Which of the following is a sort in place algorithm?
a) Selection Sort
b) Insertion Sort
c) Bubble Sort
85 If an increment or decrement operator is placed after a variable it is called as
a) post increment
b) post decrement
c) pre increment & pre decrement
d) both a & b
86 Solve the below problem using a problem solving loop. Imagine you have 25 beads and
you have to make a three digit number on an abacus, you must use all the beads. How
many three digit numbers can you make?
a) 3
b) 4
c) 5
d) 6
87 int disp[2][4] = { 10, 11, 12, 13, 14, 15, 16, 17}; what is the value disp[0][1]?
a) 11
b) 14
c) 10
d) 17
88 Which of the following uses structure?
a) Array of structures
b) Linked List
c) Stacks
d) All of the Above
89 What will be the output of the following program
a) 0.0
b) 0.1
c) 0.2
d) 0.3
90 In this 2d array abc[5][4], how many elements can be stored?
a) 5
b) 4
c) 20
d) 9
91 "What will be the output of the following C code?"
a) 1 2 3 4 5 0
b) 1 2 3 4 5 junk
c) 1 2 3 4 5 5
d) Run time error
92 The output while executing the following statement : for(i = 2; i <= 6; i = i + 2) printf("%d\t",
i + 1);
a) 3 5 7
b) 3
c) 2 4 6
d) 7
93 Binary Search is a searching algorithm for finding an element's position in a
______________ array.
a) Random array
b) Sorted array
c) Unsorted array
d) Mixed array
94 Self referential structures with single link can have___________self –pointers
a) only one
b) multiple
c) No
d) two
95 A function that calls itself is known as
a) Self Referential
b) Looping
c) Iteration
d) Recursion
96 The exit condition which prevents the function from infinite looping is called as
a) Base Condition
b) Starter
c) Recurse
d) none
97 The mode ab+ in file handling signifies
a) open a text file in both reading and writing mode
b) close a binary file in both reading and writing mode
c) open a binary file in both reading and writing mode
d) close a text file in both reading and writing mode
98 While executing the C Program, the compiler memory is
a) volatile
b) non volatile
c) permanent
d) none of the above
99 The default parameter passing mechanism is
a) Call by value
b) Call by reference
c) Call by value result
d) None
100 square( ); is an example of
a) files
b) linked list
c) conditional statements
d) arrays
106 First step in problem solving process is to
a) Design a Solution
b) Define a Problem
c) Practicing the Solution
d) Organizing the Data
107 ____________________ is a solution model to a given problem represented
diagrammatically.
a) Flowchart
b) Algorithm
c) Pseudo-code
d) All the Above
108 Which of the following are themselves a collection of different data types?
a) String
b) Structures
c) char
109 What does the Start/End symbol do?
a) Another structure
b) Function
c) Array
112 Set of instructions that mimic programming language instructions are called as
a) Flowchart
b) Algorithm
c) Pseudo-code
d) All the Above
113 Which of the following does not initialize ptr to null (assuming variable declaration of a
as int a=0;)?
a) int *ptr = &a;
b) int *ptr = &a – &a;
c) int *ptr = a – a;
114 When can algorithms be used?
a) Images or videos
b) In pseudocode or as a flowchart
c) By hardware or software
117 System flowcharts are used to show the direction of what?
a) Data
b) Information
c) Knowledge
118 Choose the right option
string* x, y;
a) x is a pointer to a string, y is a string
b) y is a pointer to a string, x is a string
c) Both x and y are pointer to string types
119 Which of the following true about FILE *fp
a) fscanf() can read from standard input whereas scanf() specifies a stream from which
to read
b) fscanf() can specifies a stream from which to read whereas scanf() can read only
from standard input
c) fscanf() and scanf() has no difference in their functions
d) fscanf() and scanf() can read from specified stream
126 What will happen when we use void in argument passing?
a) -1
b) 0
c) 1
d) 2
128 Select the best description to explain what a binary search algorithm is.
a) SCANF
b) GETS
c) GETC
d) FINDS