C Programming MCQ - Arrays

1:  

O(N)(linear time) is better than O(1) constant time.

A. True
B. False
C.
D.
 
 

Option: B

Explanation :

Click on Discuss to view users comments.

gayatri said: (2:03pm on Thursday 18th April 2013)
why???Please explain...
simar said: (8:27am on Thursday 19th November 2015)
becoz in o(n)tym we find element in the middle or the last of the series bt in o(1) we find the element at first position so its better.
md sarwer said: (9:59pm on Sunday 4th September 2016)
"order of" or O is defined the behaviour of function.O(n) is more complex bcoz of it depends upon the no. of inputs whereas O(1) solves the problem only in fist attempt.....no matter what is d no of inputs r....i think u got it
yogeshwar-9872480190 said: (6:03pm on Monday 16th January 2017)
Big Oh notation means upper bound value solinear upper bound value is worse than constant upper bound value
monika said: (5:09pm on Sunday 23rd July 2017)
o(1) simply means we find the data at the first position only whereas o(n) implies we can find data anywhere between 1st and nth position. so o(n) is time consuming.
ishita saraf said: (1:59am on Wednesday 30th May 2018)
z in o(n) paytm we find element in the mobile or the last of the series price in o(1) we find the position so its better is bar time and bar is bar.

Write your comments here:



2:   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
 
 

Option: D

Explanation :

Click on Discuss to view users comments.

Write your comments here:



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

Option: D

Explanation :

Click on Discuss to view users comments.

Write your comments here:



4:  

If x is an array of interger, 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

 
 

Option: A

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

Click on Discuss to view users comments.

kavitha said: (1:07pm on Monday 25th March 2013)
why it is C rather than A
Mayank said: (10:23pm on Monday 6th May 2013)
say base=1000 and i=4;
paddhu said: (2:19am on Saturday 24th August 2013)
it's C optiong
Narendra Kumar Rout said: (11:05pm on Tuesday 31st December 2013)
I think option B is also correct.

Write your comments here:



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

 
 

Option: A

Explanation :

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

Click on Discuss to view users comments.

ateeb said: (10:49pm on Friday 9th February 2018)
S is an array and it should be taking input in some loop. or scanf("%s",s[index number])
SANKHA NATH SEN said: (1:02pm on Sunday 18th February 2018)
Options are incorrectscanf("%s", S); only scans first parameter of input stream 1 2 3 4 5 and it's 1.Option A could have been correct if the input was 12345 instead of 1 2 3 4 5.

Write your comments here:




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