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

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. How will you print
on screen?

  • (A) printf("\n");
  • (B) printf(\ );
  • (C) echo\\n;
  • (D) printf("\\n");

A

Admin • 833.24K Points
Coach

Q. Following function is used to find the first occurrence of given string in another string

  • (A) strchar
  • (B) strnset
  • (C) strstr
  • (D) strrchr

A

Admin • 833.24K Points
Coach

Q. Which of the following is more appropriate for reading a multi_word string?

  • (A) printf
  • (B) scanf
  • (C) put
  • (D) gets

A

Admin • 833.24K Points
Coach

Q. What will be the output of the following code? Int main(){printf("Hello","Word
");return 0;}

  • (A) hello
  • (B) hello world
  • (C) world
  • (D) none of these

A

Admin • 833.24K Points
Coach

Q. What will be the output of the following code? Int main(){char str[9]="My Computer";printf("%s
",str);return 0;}

  • (A) mycompute
  • (B) syntax error
  • (C) runtime error
  • (D) none of these

A

Admin • 833.24K Points
Coach

Q. Pointer is a___________

  • (A) a keyword used to create a variable
  • (B) a variable that stores the address of some instruction
  • (C) a variable that stores the address of some other variable
  • (D) all of the above

A

Admin • 833.24K Points
Coach

Q. ____operator is used to get the value stored at address stored in pointer variable

  • (A) *
  • (B) &
  • (C) dot
  • (D) +

A

Admin • 833.24K Points
Coach

Q. Which of the following statement is true about char ****a ?

  • (A) a is pointer to a pointer to a pointer to char
  • (B) a is pointer to a pointer to a pointer to char
  • (C) a is a pointer to a char pointer
  • (D) a is a pointer to a pointer to a char

A

Admin • 833.24K Points
Coach

Q. Are *ptr++ and ++*ptr are same?

  • (A) no they are not same
  • (B) yes they are one and the same
  • (C) depends upon the value of ptr
  • (D) none of these

A

Admin • 833.24K Points
Coach

Q. What will be the output of the following code? Void main(){int a=10;int *b=&a;int **c=&b;printf("%d %d %d",a,*b,**c);}

  • (A) 10 10 garbage
  • (B) 10 garbage garbage
  • (C) 10 10 10
  • (D) syntax error

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