Data structure MCQ Quiz Hub

Data Structure and Algorithms (DSA) set 3

Choose a topic to test your knowledge and improve your Data structure skills

1. The selection sort is basically a method of repeated




2. In selection sort of n elements,how many times is the swp function called in the complete execution of the algorithm?




3. If two string are identical then strcmp() function returns____




4. How will you print on screen?




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




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




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




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




9. Pointer is a___________




10. __operator is used to get the value stored at address stored in pointer variable




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




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




13. Which of the following is a collection of different data type elements?




14. Which of the following is a collection of different data type elements?




15. Which of the following is a collection of different data type elements?




16. What is the similarity between structure,union and enum?




17. Which of the following can not be a structure member?




18. The members of the union are accessed by____




19. a-> is systematically correct if_____




20. How many bits are absolutely necessary to store an ASCII character ?




21. The result of 0001 1010 / 0001 0101 is




22. The result of 0001 1010 & 0000 1000 is ___




23. The result of 0001 1010 ~ 0100 0011 is




24. The result of 0001 1010^0001 0000 is____




25. The result of 0001 1010 << 2 is____




26. The result of 0001 1010 >>2 is____




27. The most significant bit is lost in following operation




28. The result of i)true AND false II)false or false




29. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int i=320; char *ptr=(char *)&i; printf("%d",*ptr); return 0; }




30. What will be output if you will compile and execute the following c code? #include<stdio.h> #define x 5+2 int main(){ int i; i=x*x*x; printf("%d",i); return 0; }




31. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ char c=125; c=c+10; printf("%d",c); return 0; }




32. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ float a=5.2; if(a==5.2) printf("Equal"); else if(a<5.2) printf("Less than"); else printf("Greater than"); return 0; }




33. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int i=4,x; x=++i + ++i + ++i; printf("%d",x); return 0; }




34. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int a=2; if(a==2){ a=~a+2<<1; printf("%d",a); } else{ break; } return 0;




35. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int a=10; printf("%d %d %d",a,a++,++a); return 0; }




36. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ char *str="Hello world"; printf("%d",printf("%s",str)); return 0; }




37. What will be output if you will compile and execute the following c code? #include <stdio.h> #include <string.h> int main(){ char *str=NULL; strcpy(str,"cquestionbank"); printf("%s",str); return 0; }




38. #include <stdio.h> #include <string.h> int main(){ int i=0; for(;i<=2;) printf(" %d",++i); return 0; }




39. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int x; for(x=1;x<=5;x++); printf("%d",x); return 0; }




40. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ printf("%d",sizeof(5.2)); return 0; }




41. What will be output if you will compile and execute the following c code? #include <stdio.h> #include <string.h> int main(){ char c='8'; printf("%d",c); return 0; }




42. What will be output if you will compile and execute the following c code? #include<stdio.h> #define call(x,y) x##y int main(){ int x=5,y=10,xy=20; printf("%d",xy+call(x,y)); return 0; }




43. What will be output if you will compile and execute the following c code? #include<stdio.h> int * call(); int main(){ int *ptr; ptr=call(); printf("%d",*ptr); return 0; } int * call(){ int a=25; a++; return &a; }




44. . What is error in following declaration? struct outer{ int a; struct inner{ char c; }; };




45. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int array[]={10,20,30,40}; printf("%d",-2[array]); return 0; }




46. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ int i=10; static int x=i; if(x==i) printf("Equal"); else if(x>i) printf("Greater than"); else printf("Less than"); return 0; }




47. What will be output if you will compile and execute the following c code? #include<stdio.h> #define max 5; int main(){ int i=0; i=max++; printf("%d",i++); return 0; }




48. What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){ double far* p,q; printf("%d",sizeof(p)+sizeof q); return 0; }




49. C language was invented by




50. The data type created by the data abstraction process is called




51. A variable which is visible only in the function in which it is defined, is called




52. Unsigned integers occupies




53. Which of the following data structure is linear type ?




54. Which of the following data structure is linear type ?




55. In C, if you pass an array as an argument to a function, what actually gets passed?




56. Which data structure allows deleting data elements from front and inserting at rear?




57. Queue is a -------------- List .




58. A node in a linked list must contain at least




59. An algorithm is made up of two independent time complexities f (n) and g (n). Then the complexities of the algorithm is in the order of




60. Big O notation is defined for