Classical

C Programming MCQ - Arrays

6:  

Size of the array need not be specified, when

A.

Initialization is a part of definition

B.

It is a declaratrion

C.

It is a formal parameter

D.

All of these

 
 

Option: A

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'.

Click on Discuss to view users comments.

Naveen Kumar Chaudhary said: (6:54am on Friday 5th July 2013)
The answer is wrong as size must be specified during declaration.The answer must be [c].If you have any clarification ,please mail me.
Narendra Kumar Rout said: (8:11am on Wednesday 1st January 2014)
I think option A and C is correct

Write your comments here:



7:  

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

 
 

Option: C

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))

Click on Discuss to view users comments.

Artimis said: (10:07pm on Monday 1st July 2013)
1120 (48*3)=1267 how is 1264???
k.karuna said: (9:12pm on Wednesday 21st June 2017)
48*3=1441120 144=1264

Write your comments here:



8:  

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

 
 

Option: C

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.

Click on Discuss to view users comments.

Bipin Bihari Pathak said: (9:51am on Saturday 22nd December 2012)
Unable to understand how?
ASHVIN said: (9:09pm on Saturday 12th January 2013)
i can't understand
vijay kumar said: (6:01am on Friday 29th March 2013)
Unable to understand how?
Anoop Rekha said: (8:41pm on Tuesday 7th May 2013)
Element 70 and 40 violates the rule. Hence they must be shifted to its proper position. first swap 70 with 10 2nd swap 70 with 14then from other side swap 40 with 19. So three interchanges required. Ans should be three
Mayank said: (4:09am on Wednesday 8th May 2013)
I m getting three (3)
ruchi said: (6:57am on Tuesday 23rd June 2015)
not understandexplain with to draw the heap structure

Write your comments here:



9:  

Which of the following is an illegal array definition?

A.

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

B.

var a:array[REAL]of REAL;

C.

var a:array['A'..'Z']of REAL;

D.

var a:array[BOOLEAN]of REAL;

 
 

Option: B

Explanation :

Click on Discuss to view users comments.

gayatri said: (12:16am on Friday 19th April 2013)
not able to understand....can u please explain??
chintan said: (1:15am on Sunday 28th April 2013)
as per my perspective D is the right answer.
Mayank said: (5:00am on Wednesday 8th May 2013)
only option B is array of continuous function. you can't make array of [real] of real nos. It does not have discrete elements so can't be indexed. so Given ans is right.
Surendra Kr. Sharma said: (2:06am on Wednesday 7th October 2015)
Array indexes must be discrete, in option B [REAL] is continuous therefore it is illegal definition.

Write your comments here:



10:   Minimun 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
 
 

Option: B

Explanation :

Click on Discuss to view users comments.

Write your comments here:







Suggest an improvement

 


Syllabus Covered in this section is

  • Elements of C-Tokens
  • Identifiers
  • data types in C
  • Control structures in, C
  •  Sequence, selection and iteration(s).
  • Structured data types in C
  • Arrays, Structures, union, String, and pointers
  • Functions, Recursion
  • Parameter passing, Scope
  •  Binding, Abstract data types

This Section covers Multiple Choice Questions Answers in C Programming . Here questions answers are given with explanation and references. These questions can be used for the preparation of various competitive and academic exams.

Who can benefit - 

  • Any undergraduate or postgraduate student who is seeking C Programming objective type questions answers can use this section.
  • C programming Multiple Choice questions Answers can help you in interview preparation.
  • C Programming Objective type Questions Answers are also used at SSC and HSc level for Exam preparation.
  • C Programming MCQ Questions Answers are also used by engineering students in the preparation of their Exams.
  • Any candidate who has to appear for DOEACC A, B or C level Exam can also learn C Programming Questions Answers.
  • All the teachers who are appearing for Kendriya Vidyalya Sangathan Entrance Exam can also use C Programming Multiple Choice Questions Answers.
  • C Programming MCQs can also be used by the students who are pursuing B.Sc or Msc Computer Science.
  • C Programming Questions Answers can also be used by BCA students for the preparation of their exams.
  • Any student who is pursuing B.Sc. in Information Technology can also use this C Programming mcq Questions Answers.
  •  MCA students can also prepare for their exams using  C Programming Objective Type Questions Answers.
  • You can get free access to C Programming mcq pdf.
  • You can also have online access to C Programming Questions Answers EBook.

Various Search Terms used for this section are

  • C Programming quiz questions with answers

  • C Programming exam questions answers

  • C Programming MCQ questions Answers

  • C Programming MCQ

  • C Programming Questions Answers