Data Structure and Algorithms (DSA) MCQs with answers Page - 17

Here, you will find a collection of MCQ questions on Data Structure and Algorithms (DSA). Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. To declare an array S that holds a 5-character string, you would write

  • (A) char s[5]
  • (B) char s[6]
  • (C) string s[5]
  • (D) stringchar s[5]

A

Admin • 833.24K Points
Coach

Q. The constructed datatype in C is known as

  • (A) string
  • (B) array
  • (C) structure
  • (D) pointer

A

Admin • 833.24K Points
Coach

Q. The function islower(char)checks whether a character is in lower case or not.Therefore it should return______

  • (A) 0 or 1
  • (B) -1, 0 or 1
  • (C) a character
  • (D) nothing

A

Admin • 833.24K Points
Coach

Q. A variable P is called pointer if__

  • (A) p contains the address of an element in data
  • (B) p points to the address of first element in data
  • (C) p can store only memory address
  • (D) p contain the data and the address of data

A

Admin • 833.24K Points
Coach

Q. The difference between linear array and a record is_____

  • (A) an array is suitable for homogeneous data but the data items in a record may have different data type
  • (B) in a record,theremay not be a natural ordering in opposed ti linear array
  • (C) a record form a hierarchical structure but a linear array does not
  • (D) all of above

A

Admin • 833.24K Points
Coach

Q. If s1 is "ABC" and s2 is "DEF" then strcat(s1,s2)will give the following result.

  • (A) s1="abcdef" and s2="def"
  • (B) s1="abcdef" and s2="def"
  • (C) s1="abc" and s2="abcdef"
  • (D) s1="abc" and s2="abcdef"

A

Admin • 833.24K Points
Coach

Q. Give output of the following programint main(){inta[]={2,3,4,5,6};printf("%d",2[a]);}

  • (A) compilation error
  • (B) run time error
  • (C) 4
  • (D) 2

A

Admin • 833.24K Points
Coach

Q. Where do we use the operator --> ?

  • (A) to access a member of structure
  • (B) to access member of union
  • (C) to access an array
  • (D) both(a) and(b).

A

Admin • 833.24K Points
Coach

Q. The function strcmp(s1,s2)will return -1 if____

  • (A) s1>s2
  • (B) s1=s2
  • (C) s1<s2
  • (D) function does not return -1.

A

Admin • 833.24K Points
Coach

Q. Which of the following data structure store the homogeneous data elements?

  • (A) arrays
  • (B) records
  • (C) pointers
  • (D) none

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ