Academic Task knows that computer subject becomes necessary for all the students from various branches, and this platform will provide them all the required knowledge to answer the Questions correctly in the various competitive exams and entrance tests. Academictask is trying to make all those Computer Science MCQs topics more simple and easy to understand So that it will help students to learn it very quickly in a limited amount of time like last peak hours of their Extermination, it’s like last time revision Notes. In Computer Science MCQs with answers, sections cover topics like Basic Computer MCQs, C Programming MCQs, Computer Networks, Data Structures, Database Management MCQs, Operating System (UNIX, LINUX, Window), Computer Organizations and Architecture, Data Mining –  and much more. Also, check MCQs on Software Engineering here.

Computer Science and Quiz Test for Preparation

S.NoComputer Science MCQsComputer Science Quiz
1Basic Computer MCQSBasic Computer Quiz

01. O(N)(linear time) is better than O(1) constant time.
A. True
B. False

02. For ‘C’ programming language
A. Constant expressions are evaluated at compile
B. String constants can be concatenated at compile time
C. Size of array should be known at compile time
D. All of these

03. What is the maximum number of dimensions an array in C may have?
A. Two
B. Eight
C. Twenty
D. Theoretically no limit. The only practical limits are memory size and compilers

04. If x is an array of integer, then the value of &x[i] is same as
A. &x[i-1] + sizeof (int)
B. x + sizeof (int) * i
C. x+i
D. none of these

Explanation:
X+i means increment in value of X not in address of X so it cant represent address of X.
&x[i] means address of the ith element.
So & X[i-1] defines address of i-1 element .sizeof(int) defines size of an element
So &x[i-1] + sizeof(int) means address of i-1 element plus size of an element that means address of ith element.
It cant be option c as x+i is not representing any address.
X+i means increment in value of X not in address of X so it cant represent address of X.
So option (A) is correct

5. If S is an array of 80 characters, then the value assigned to S through the statement scanf(“%s”,S) with input 12345 would be
A. “12345”
B. nothing since 12345 is an integer
C. S is an illegal name for string
D. %s cannot be used for reading in values of S

Explanation:
scanf(“%s”, S) only scans first parameter of input stream .So Option A is correct.

06. Size of the array need not be specified, when
A. Initialization is a part of definition
B. It is a declaration
C. It is a formal parameter
D. All of these

Explanation:
Consider the following declaration
double balance[] = {1000.0, 2.0, 3.4, 17.0, 50.0};
If you omit the size of the array, an array just big enough to hold the initialization is created. So, correct option is ‘A’.

07.A one dimensional array A has indices 1….75.Each element is a string and takes up three memory words. The array is stored starting at location 1120 decimal. The starting address of A[49] is
A. 1167
B. 1164
C. 1264
D. 1169

Explanation:
One element takes three memory words so memory location 1120 , 1121 , 1123 stores first element.
A[49] will be stored at location 1264 , (1120+(48*3))

08. Minimum number of interchange needed to convert the array 89,19,40,14,17,12,10,2,5,7,11,6,9,70, into a heap with the maximum element at the root is

A. 0

B. 1

C. 2

D. 3

Explanation :
Only element 70 violates the rule. Hence, it must be shifted to its proper position.
Step1: swap(10, 70)
Step2: swap(40, 70)
Hence, only 2 interchanges are required.

9. Which of the following is an illegal array definition?

A. Type COLOGNE:(LIME,PINE,MUSK,MENTHOL); var a:array[COLOGNE]of REAL;

B. bvar a:array[REAL]of REAL;

C. var a:array[‘A’..’Z’]of REAL;

D. var a:array[BOOLEAN]of REAL;

10. Minimum number of comparison required to compute the largest and second largest element in array is
A. n-[log₂n]-2
B. n+[log₂n-2]
C. log₂n
D. None of these

NOTE
IF YOU THINK ANY OF THE MCQ ABOVE IS WRONG.
PLEASE COMMENT WITH CORRECT ANSWER AND ITS DETAIL EXPLANATION IN COMMENT BOX.
THANK YOU

Leave a Reply